Example #1
0
 private void Awake()
 {
     playerManagerScript      = GameObject.FindObjectOfType <PlayerManagerScript>();
     damagePopUpManagerScript = GameObject.FindObjectOfType <DamagePopUpManagerScript>();
     if (animator == null)
     {
         animator = GetComponentInChildren <Animator>();
     }
     animator.Play(animationName);
 }
Example #2
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (health_current > 0 && animator.GetBool("Dead"))
        {
            animator.SetBool("Dead", false);
        }

        if (moveDirection.magnitude > 0.1f && isPlayer)
        {
            move();
            locationLastFrame = transform.position;
        }

        try
        {
            if (spriteRenderer.material.GetFloat("_Outline") > 0.01f)
            {
                spriteRenderer.material.SetFloat("_Outline", spriteRenderer.material.GetFloat("_Outline") - Time.fixedDeltaTime * 2f);
            }
        }
        catch (System.Exception _)
        {
        }

        if (isTurn)
        {
            showEffectedList();
            displayCurrentStates();
        }

        if (soundManager == null)
        {
            soundManager = FindObjectOfType <SoundManager>();
        }
        if (damagePopUpManagerScript == null)
        {
            damagePopUpManagerScript = FindObjectOfType <DamagePopUpManagerScript>();
        }
    }
Example #3
0
 // Start is called before the first frame update
 private void Awake()
 {
     damagePopUpManagerScript = GameObject.FindObjectOfType <DamagePopUpManagerScript>();
     soundManager             = GameObject.FindObjectOfType <SoundManager>();
 }