Example #1
0
    protected virtual void Start()
    {
        MyRigidBody2D = gameObject.GetComponent <Rigidbody2D>();
        MyAnimator    = gameObject.GetComponent <Animator>();

        StartPosition = transform.position;

        PlayerStats = GameObject.FindGameObjectWithTag(PlayerTag).GetComponent <ThorStats>();
    }
Example #2
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.CompareTag(PlayerTag))
        {
            ThorStats PlayerStats = GameObject.FindGameObjectWithTag(PlayerTag).GetComponent <ThorStats>();

            PlayerStats.TakeDamage(Damage);
        }

        Destroy(gameObject);
    }
Example #3
0
 private void Start()
 {
     PlayerStats = GameObject.FindGameObjectWithTag(PlayerTag).GetComponent <ThorStats>();
 }
Example #4
0
 private void Start()
 {
     PlayerStats = GetComponent <ThorStats>();
 }
Example #5
0
 private void Start()
 {
     Thor        = Player.GetComponent <Thor>();
     ThorStats   = Player.GetComponent <ThorStats>();
     AreaManager = GetComponent <AreaManager>();
 }
Example #6
0
 private void Start()
 {
     PlayerStats    = Player.GetComponent <ThorStats>();
     PlayerMovement = Player.GetComponent <Thor>();
     AreaManager    = GetComponent <AreaManager>();
 }
Example #7
0
 private void Start()
 {
     Stats = GameObject.FindGameObjectWithTag(TargetTag).GetComponent <ThorStats>();
 }