Beispiel #1
0
 private void Start()
 {
     anim = GetComponent <Animator>();
     anim.SetBool("canAttack", combatEnabled);
     PC = GetComponent <PlayerPlatformAdvenced>();
     PS = GetComponent <PlayerState>();
 }
Beispiel #2
0
    private void Start()
    {
        currentHealth = maxHealth;

        pc = GameObject.Find("Player").GetComponent <PlayerPlatformAdvenced>();

        aliveGO     = transform.Find("Alive").gameObject;
        brokenTopGO = transform.Find("Broken Top").gameObject;
        brokenBotGO = transform.Find("Broken Bottom").gameObject;

        aliveAnim   = aliveGO.GetComponent <Animator>();
        rbAlive     = aliveGO.GetComponent <Rigidbody2D>();
        rbBrokenTop = brokenTopGO.GetComponent <Rigidbody2D>();
        rbBrokenBot = brokenBotGO.GetComponent <Rigidbody2D>();

        aliveGO.SetActive(true);
        brokenTopGO.SetActive(false);
        brokenBotGO.SetActive(false);
    }