public ShowerHead GetShower() { ShowerHead curShower = unUsedShowers[Random.Range(0, (unUsedShowers.Count - 1))]; unUsedShowers.Remove(curShower); return(curShower); }
private void ShowerTime() { Shower curShower = RoomManager.instance.GetClosestShower(this.gameObject); ShowerHead showerHead = curShower.GetShower(); agent.SetDestination(showerHead.transform.position); }
void Update() { if (!bambooReady) { return; } oddFrame = !oddFrame; int startFrame = oddFrame ? 1 : 0; for (int i = startFrame; i < allBamboo.Length; i += 2) { BambooInfo bambooInfo = allBamboo[i]; float amount = swayCurve.Evaluate(Time.time * bambooInfo.animFrequency) * bambooInfo.animAmplitude; Quaternion rotOffset = Quaternion.AngleAxis(amount, Vector3.right); bambooInfo.obj.localRotation = bambooInfo.startRot * rotOffset; } for (int i = 0; i < showerHeads.Length; i++) { ShowerHead showerHead = showerHeads[i].GetComponent <ShowerHead>(); if (showerHead.ShowerOn) { foreach (BambooInfo bambooInfo in stemsGroups[i]) { float amount = swayCurve.Evaluate(Time.time * bambooInfo.animFrequency) * bambooInfo.animAmplitude; Quaternion rotOffset = Quaternion.AngleAxis(amount, bambooInfo.obj.right); bambooInfo.obj.localRotation = bambooInfo.startRot * rotOffset; } } } }
void FindShowerHeads() { showerHeads = new ShowerHead[3]; for (int i = 0; i < showerHeads.Length; i++) { GameObject newShowerHead = GameObject.Find("ShowerHead" + (i + 1)); GameObject newShowerHeadObj = GameObject.Find("SHOWERHEAD_0" + (i + 1)); ShowerHead head = newShowerHead.GetComponent <ShowerHead>(); head.AddRenderer(newShowerHeadObj.GetComponent <Renderer>()); //head.AddFallOffCurve(pipeFallOff); showerHeads[i] = head; head.AddBamboo(bamboo.GetGroup(i)); } }
public void AddShowerHead(ShowerHead _showerHead) { showerHead = _showerHead; SetPipeReady(); }
public void AddShowerHead(ShowerHead _showerHead) { showerHead = _showerHead; }