예제 #1
0
    public ShowerHead GetShower()
    {
        ShowerHead curShower = unUsedShowers[Random.Range(0, (unUsedShowers.Count - 1))];

        unUsedShowers.Remove(curShower);
        return(curShower);
    }
예제 #2
0
    private void ShowerTime()
    {
        Shower     curShower  = RoomManager.instance.GetClosestShower(this.gameObject);
        ShowerHead showerHead = curShower.GetShower();

        agent.SetDestination(showerHead.transform.position);
    }
예제 #3
0
    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;
                }
            }
        }
    }
예제 #4
0
 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));
     }
 }
예제 #5
0
파일: Pipe.cs 프로젝트: arabeenradar/unreal
 public void AddShowerHead(ShowerHead _showerHead)
 {
     showerHead = _showerHead;
     SetPipeReady();
 }
예제 #6
0
 public void AddShowerHead(ShowerHead _showerHead)
 {
     showerHead = _showerHead;
 }