public override void Use() { if (useIsAllowed) { base.Use(); Rumble(); GameObject wall = Instantiate(wallPrefab); BasePlayer p = OwnerScript.GetComponent <BasePlayer>(); p.name = "PantomimeWall"; wall.transform.position = transform.position + transform.forward * 2f; wall.transform.rotation = transform.rotation; useIsAllowed = false; StartCoroutine(WaitForNextAbility()); } }
public override void Use() { if (useIsAllowed) { if (GameObject.FindGameObjectWithTag("Pie") == null) { base.Use(); Rumble(); GameObject obj = Instantiate(piePrefab); BasePlayer p = OwnerScript.GetComponent <BasePlayer>(); PieBehaviour pie = obj.GetComponent <PieBehaviour>(); pie.OwnerScript = this.OwnerScript; pie.PlayerActions = p.PlayerActions; pie.RumbleManager = p.RumbleManager; obj.transform.position = transform.position - transform.forward * 1.5f; obj.transform.rotation = transform.rotation; useIsAllowed = false; StartCoroutine(WaitForNextAbility()); } else { BasePlayer player = OwnerScript.GetComponent <BasePlayer>(); if (player != null) { player.Energy += EnergyCost; } } } }