/// <summary> /// Moth activation used in stationary levels e.g. Boss fights /// </summary> public void ActivateMothInRange(float minY, float maxY, Moth.MothColour colour) { Moth newMoth = GetNextObject(); float xPos = 10f + GameObject.FindGameObjectWithTag("MainCamera").transform.position.x; var spawnTf = new Spawnable.SpawnType { Pos = new Vector2(xPos, Random.Range(minY, maxY)), Rotation = new Quaternion(), Scale = Vector2.one }; newMoth.Activate(spawnTf, colour, MothPathHandler.MothPathTypes.Sine); }
public void ActivateMothFromEssence(Vector2 spawnLoc, Moth.MothColour colour, float despawnTimer) { Moth newMoth = GetNextObject(); spawnLoc += new Vector2(GameObject.FindGameObjectWithTag("MainCamera").transform.position.x, 0f); var spawnTf = new Spawnable.SpawnType { Pos = spawnLoc, Rotation = new Quaternion(), Scale = Vector2.one }; newMoth.Activate(spawnTf, colour, MothPathHandler.MothPathTypes.Clover); newMoth.StartCoroutine("SpawnFromEssence", despawnTimer); }
public void ActivateAbility(Moth.MothColour colour) { switch (colour) { case Moth.MothColour.Green: _thePlayer.Lantern.ChangeColour(Lantern.LanternColour.Green); _thePlayer.Fog.Echolocate(); break; case Moth.MothColour.Gold: _thePlayer.Lantern.ChangeColour(Lantern.LanternColour.Gold); _data.StoryData.TriggerEvent(StoryEventID.FirstGoldMoth); _thePlayer.ActivateHypersonic(); _thePlayer.Fog.Echolocate(); break; case Moth.MothColour.Blue: _thePlayer.Lantern.ChangeColour(Lantern.LanternColour.Blue); _thePlayer.Fog.Echolocate(); break; } _thePlayer.AddShieldCharge(); }