Пример #1
0
    private bool CheckSlowableEnemy(string threat, GameObject threatObject)
    {
        if (threat == "EnemyShit")
        {
            ShitBehaviour enemyShit = threatObject.GetComponent <ShitBehaviour> ();
            if (enemyShit.exploded)
            {
                return(true);
            }
        }

        return(false);
    }
Пример #2
0
    private void DropShit()
    {
        GameObject    shit          = this.shitPool.Get();
        MoveTo        shitMove      = shit.GetComponent <MoveTo> ();
        ShitBehaviour shitBehaviour = shit.GetComponent <ShitBehaviour> ();

        Vector2 playerPosition = this.player.localPosition;
        Vector2 shitPosition   = new Vector2(playerPosition.x, 6);

        shit.transform.localPosition = shitPosition;

        shit.SetActive(true);
        shitMove.OnMove += shitBehaviour.Explode;
        shitMove.MoveToPosition(new Vector2(playerPosition.x, playerPosition.y), this.shitVelocity + Random.Range(0f, 2f));
    }
Пример #3
0
 private void CheckIfThreatCollided(string threat, GameObject threatObject)
 {
     if (this.possibleThreats.Contains(threat))
     {
         if (threat == "EnemyShit")
         {
             ShitBehaviour enemyShit = threatObject.GetComponent <ShitBehaviour> ();
             if (!enemyShit.exploded)
             {
                 this.Die();
             }
         }
         else
         {
             this.Die();
         }
     }
 }