public void tyran() { width = .5F; height = .25F; type = (int)SpaceRules.Type.CageTyra; GameObject b = GameObject.Find("Player_" + playerNo); parc = b.GetComponent <ParcManager> (); parc.PurchaseDino(cacage, new Tyrannosaurus()); create(tyr); this.GetComponent <GameInterface>().allInactive(); //patateobject.AddComponent<Tyrannosaurus>(); }
public void trice() { width = .5F; height = .3F; type = (int)SpaceRules.Type.CageTric; GameObject b = GameObject.Find("Player_" + playerNo); parc = b.GetComponent <ParcManager> (); parc.PurchaseDino(cacage, new Triceratop()); create(tri); this.GetComponent <GameInterface>().allInactive(); //patateobject.AddComponent<Triceratop>(); }
public void veloc() { width = .5F; height = .3F; type = (int)SpaceRules.Type.CageVelo; GameObject b = GameObject.Find("Player_" + playerNo); parc = b.GetComponent <ParcManager> (); parc.PurchaseDino(cacage, new Velociraptor()); create(velo); this.GetComponent <GameInterface>().allInactive(); //patateobject.AddComponent<Velociraptor>(); }
public IEnumerator throwDice(ParcManager player) { GameObject dice = (GameObject)Resources.Load("Dé6"); Transform cameraPos = Camera.main.transform; GameObject intanciatedObject = (GameObject)Instantiate(dice, new Vector3(cameraPos.position.x + 2, cameraPos.position.y - 6, cameraPos.position.z - 2), Quaternion.identity); intanciatedObject.transform.parent = transform; Dice diceScript = GetComponentInChildren <Dice>(); yield return(new WaitUntil(() => diceScript.isFinished)); player.nbVisitors += diceScript.diceResult; }
public IEnumerator throwDice(ParcManager player) { NewBehaviourScript diceScript = null; string name; GameObject thrownDice; instanciatedObject = (GameObject)Instantiate(diceBox, new Vector3(cameraPos.position.x, cameraPos.position.y - 6, cameraPos.position.z), Quaternion.identity); instanciatedObject.transform.parent = transform; switch (player.dangerLevel) { case ParcManager.Danger.Low: name = "dice_12"; break; case ParcManager.Danger.Medium_low: name = "dice_10"; break; case ParcManager.Danger.Medium: name = "dice_8"; break; case ParcManager.Danger.Medium_high: name = "dice_6"; break; default: name = "dice_4"; break; } foreach (Transform child in instanciatedObject.transform) { if (child.name == name) { thrownDice = child.gameObject; thrownDice.SetActive(true); diceScript = thrownDice.GetComponent <NewBehaviourScript>(); } } yield return(new WaitWhile(() => diceScript.isMoving)); diceResult = instanciatedObject.GetComponentInChildren <testTrigger>().getDiceResult(); diceFinished = true; }
// Update is called once per frame void Update() { if (creating) { if (once) { GameObject b = GameObject.Find("Player_" + playerNo); parc = b.GetComponent <ParcManager> (); parc.SetAvailability(type); once = false; } InstantiateRect(); CreateObj(type); } if (checkingCage) { cageIsEmpty(); } }