private bool CheckSlowableEnemy(string threat, GameObject threatObject) { if (threat == "EnemyShit") { ShitBehaviour enemyShit = threatObject.GetComponent <ShitBehaviour> (); if (enemyShit.exploded) { return(true); } } return(false); }
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)); }
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(); } } }