public override void Use(GameObject go) { controller = go.GetComponent <SausageController>(); controller.HasGost = true; GhostItemManager.Update(controller, true); Manager.GetTimer().New(End, duration, true); }
private void AddSausage() { audioPlayer.PlayOneShot(grow); UpdateList(); GameObject newSausage = Instantiate(sausage, lastSausage.transform.position - lastSausage.transform.up * 2.05f, lastSausage.transform.rotation) as GameObject; newSausage.GetComponent <HingeJoint>().connectedBody = lastSausage.GetComponent <Rigidbody>(); lastSausage = newSausage; newSausage.transform.parent = body; newSausage.transform.name = "Sausage (" + lastId + ")"; newSausage.GetComponent <Sausage>().sauController = this; sausages.Add(newSausage); if (godMod) { newSausage.GetComponent <Sausage>().undemagible = true; } if (hasGhost) { GhostItemManager.Update(this, true); } }
//private IEnumerator ReturnLayer () { // yield return new WaitForSeconds(duration); // Destroy(gameObject); //} public void End() { GhostItemManager.Update(controller, false); controller.HasGost = false; }