public void AntDied(Anthill anthill) { if (anthill.gameObject.tag == "Player") { Points -= 50; } }
public void CollectApple(Anthill anthill) { if (anthill.gameObject.tag == "Player") { Points += 100; } }
public void CollectSugar(Anthill anthill) { if (anthill.gameObject.tag == "Player") { Points += 1; } }
public void Initialize(Anthill anthill, GameManager gameManager, string scriptName) { _state = State.Idle; _anthill = anthill; _gameManager = gameManager; _nearSugar = new List <Sugar>(); _nearApples = new List <Apple>(); _antScript = new AntScript(this, scriptName); }
private void SpawnAnts(Anthill anthill) { const int antCount = 20; const float radius = 6f; for (var i = 0; i < antCount; i++) { var angle = i * 360 / antCount; var offset = Quaternion.Euler(0f, angle, 0f) * Vector3.forward * radius; var obj = Instantiate(AntPrefab); obj.transform.parent = anthill.AntContainer; obj.transform.position = offset + anthill.transform.position; obj.transform.rotation = Quaternion.LookRotation(offset); obj.name = string.Format("ant {0}", _antNumber++); var ant = obj.GetComponent <Ant>(); ant.Initialize(anthill, this, _parameters.AntScriptName); } }
public void Reach(Anthill anthill) { CallLuaFunction(reachAnthill); }