Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

Unity Bullet script


public class BulletType : MonoBehaviour
{
    // Protected is less stric than private, more stric than public
    // Protected variables only accesible to this class and its child.
    protected string name;
    protected int bulletDamage;
    protected int bulletSpeed;

    protected virtual void Start()
    {

    }

    // Virtual means you can override this method in child classes
    protected virtual void Damage() { }

    public virtual void PlaySound() { }

    protected virtual void ShowEffect() { }
}

Source by w3programmers.org #
 
PREVIOUS NEXT
Tagged: #Unity #Bullet #script
ADD COMMENT
Topic
Name
2+4 =