示例#1
0
 public void InitJourney(JourneyMan jman, Person pers, Vehicle vehi, BldRoom br1, BldRoom br2, string description, float finsecs = 5, float starsecs = 3, string jorg = "")
 {
     this.jman = jman;
     jindex    = jman.curjidx++;
     //jgo = new GameObject();
     this.description = description;
     //this.description = description;
     name             = "j" + jindex.ToString("D3") + " " + this.description;
     transform.parent = jman.transform;
     legs             = new List <Leg>();
     //pathctrl = jgo.AddComponent<PathCtrl>();
     pathctrl = gameObject.AddComponent <PathCtrl>();
     pathctrl.SetSceneMan(jman.sman);
     //birdctrl = jgo.AddComponent<BirdCtrl>();
     birdctrl      = gameObject.AddComponent <BirdCtrl>();
     birdctrl.sman = jman.sman;
     createtime    = Time.time;
     person        = pers;
     vehicle       = vehi;
     if (jman.sman.fastMode)
     {
         startSecsToDelay    = Mathf.Min(starsecs, 1.2f);
         finishSecsToDestroy = Mathf.Min(finsecs, 1.2f);
     }
     else
     {
         startSecsToDelay    = starsecs;
         finishSecsToDestroy = finsecs;
     }
     failedSecsToDestroy = 10;
     person.journey      = this;
     status  = JourneyStatE.WaitingToStart;
     jnyTime = Time.time;
     jman.LogJourney(this, br1, br2);
 }
示例#2
0
        void LinkObjectsAndComponents()
        {
            sman = FindObjectOfType <SceneMan>();
            if (sman == null)
            {
                Debug.Log("Cound not find RegionMan");
            }
            jman = sman.jnman;
            gman = sman.gaman;
            lman = sman.loman;
            var cango = GameObject.Find("SimParkUICanvas");

            canvas = cango.GetComponent <Canvas>();
            canvas = cango.GetComponent <Canvas>();

            optionsPanelGo = transform.Find("OptionsPanel").gameObject;
            optionsPanel   = optionsPanelGo.GetComponent <OptionsPanel>();
            if (optionsPanelGo.activeSelf)
            {
                optionsPanelGo.SetActive(false);
            }

            runButton     = transform.Find("RunButton").gameObject.GetComponent <Button>();
            frameButton   = transform.Find("FrameButton").gameObject.GetComponent <Button>();
            evacButton    = transform.Find("EvacButton").gameObject.GetComponent <Button>();
            unevacButton  = transform.Find("EvacButton").gameObject.GetComponent <Button>();
            freeFlyButton = transform.Find("FreeFlyButton").gameObject.GetComponent <Button>();
            freeFlyPanel  = transform.Find("FreeFlyHelpPanel").gameObject;
            fteButton     = transform.Find("FteButton").gameObject.GetComponent <Button>();
            conButton     = transform.Find("ConButton").gameObject.GetComponent <Button>();
            secButton     = transform.Find("SecButton").gameObject.GetComponent <Button>();
            visButton     = transform.Find("VisButton").gameObject.GetComponent <Button>();
            unkButton     = transform.Find("UnkButton").gameObject.GetComponent <Button>();
            vt2dButton    = transform.Find("Vt2DButton").gameObject.GetComponent <Button>();
        }