예제 #1
0
 // Start is called before the first frame update
 void Start()
 {
     Health = MaxHealth;
     rb     = GetComponent <Rigidbody2D>();
     scorer = FindObjectOfType <ScorePlayers>();
     OnDie.AddListener(() => scorer.EnemyKill(this));
 }
예제 #2
0
    void Start()
    {
        rb   = GetComponent <Rigidbody2D>();
        rend = GetComponent <SpriteRenderer>();

        Health = MaxHealth;

        scorer = FindObjectOfType <ScorePlayers>();

        if (ID == PlayerID.Left)
        {
            graphics = SelectorScript.instance.leftGraphics;
        }
        else if (ID == PlayerID.Right)
        {
            graphics = SelectorScript.instance.rightGraphics;
        }

        rend.sprite = graphics.FrontSprite;
    }