public override void Use(S_Player player, S_Tile tile) { S_Enemy swappee = (S_Enemy)tile.occupier; float time = 0.2f; Color col = Colours.GREEN; int width = (S_Tile.width - S_Camera.scale) / S_Camera.scale; int height = S_Tile.height / S_Camera.scale; GameObject flasher = S_Flasher.CreateFlasher(width, height, col, time); Util.SetLayer(flasher, Util.LayerName.UI, 0); flasher.transform.SetParent(tile.transform, false); flasher = S_Flasher.CreateFlasher(width, height, col, time); Util.SetLayer(flasher, Util.LayerName.UI, 0); flasher.transform.SetParent(player.currentTile.transform, false); swappee.CancelMove(); swappee.MoveToTile(player.currentTile, true); player.MoveToTile(tile, true); swappee.Stun(1); Sounds.PlaySound(Sounds.teleport); SuccessfulUse(); Level.Get(gameObject).EnemyTurn(); }
private void OnTriggerEnter(Collider other) { GameObject collisionWith = other.gameObject; S_Enemy enemy = collisionWith.GetComponent <S_Enemy>(); if (enemy != null) { ParentSpaceship.GetComponent <S_PlayerMovement>().score += 100; float score = ParentSpaceship.GetComponent <S_PlayerMovement>().score; Debug.Log(score); enemy.Destruction(); StartCoroutine(CameraShake.Shake(.2f, .1f)); Destruction(); } }