Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        transform.position = new Vector3(Mathf.PingPong(Time.time * 5, max - min) + min, transform.position.y, transform.position.z);

        if (Health <= 0)
        {
            if (gameObject.name == "chad")
            {
                Player1.exp   += NMExp;
                Player1.score += NMExp;
                Tube.NextScene();
            }
            Destroy(collider1.gameObject);
            Player1.exp   += NMExp;
            Player1.score += NMExp;
        }

        if (_attackAllow)
        {
            if (weaponCollider.IsTouching(collider1))
            {
                _attackAllow = false;
                takeDamage(Player1.damage);
            }
        }
        else
        {
            if (!weaponCollider.IsTouching(collider1))
            {
                _attackAllow = true;
            }
        }

        if (_NMEattackAllow)
        {
            if (playerCollider.IsTouching(collider1))
            {
                Player1.takeDamage(Damage);
                _NMEattackAllow = false;
            }
        }
        else
        {
            if (!playerCollider.IsTouching(collider1))
            {
                _NMEattackAllow = true;
            }
        }
    }
Exemple #2
0
 void PlayOnClick()
 {
     Tube.NextScene();
     timer = 0;
 }