private void HandleSpawned(CreatureStats creature, MapPosition at) { if (creature != ownerStats) { return; } switch (ownerStats.OwnedBy) { case Owner.PLAYER: ownerStats.AddAttackDirection(Direction.DOWNLEFT); ownerStats.AddAttackDirection(Direction.UPLEFT); break; case Owner.ENEMY: ownerStats.AddAttackDirection(Direction.DOWNRIGHT); ownerStats.AddAttackDirection(Direction.UPRIGHT); break; } }
private void Start() { GM = GameObject.FindWithTag("GM"); stats = GetComponent <CreatureStats>(); stats.MakeImobile(); // Make them able to attack everywhere Direction[] dirs = { Direction.DOWNLEFT, Direction.DOWNRIGHT, Direction.UPLEFT, Direction.UPRIGHT }; foreach (Direction dir in dirs) { stats.AddAttackDirection(dir); } EventManager.OnPermanentDestroyed += OnPermanentDestroyed; }