Пример #1
0
    void Update() //Every frame... I think we can clear this entirely up if we search enough in the code. TODO: make it empty.
    {
        cmui    = GameObject.Find("Crew Members bg").GetComponent <CrewMemberUI>();
        cs      = GameObject.Find("Crew Member").GetComponent <CrewSlot>();
        pr      = GameObject.Find("Pilot Reader").GetComponent <PilotReader>();
        jmp     = GameObject.Find("WriteJump").GetComponent <Text>();
        spd     = GameObject.Find("WriteSpeed").GetComponent <Text>();
        tmr     = GameObject.Find("WriteTimer").GetComponent <Text>();
        nameone = GameObject.Find("SHIPNAME").GetComponent <Text>();
        crew1   = GameObject.Find("Crew2Text").GetComponent <Text>();
        crew2   = GameObject.Find("Crew1Text").GetComponent <Text>();

        if (!inGame)
        {
            jmp.text     = jump + "";
            spd.text     = speed + "";
            tmr.text     = timer + "";
            nameone.text = name1;
        }

        // The following text is the add. of crew members stats. The third is available if we want to expand the crew.
        jump  = Pj + c1j + c2j /*+ c3j*/;
        speed = Ps + c1s + c2s /*+ c3s*/;
        timer = Pt + c1t + c2t /*+ c3t*/;
    }
Пример #2
0
 // Update is called once per frame
 void Awake()
 {
     jmp     = GameObject.Find("WriteJump").GetComponent <Text>();
     spd     = GameObject.Find("WriteSpeed").GetComponent <Text>();
     tmr     = GameObject.Find("WriteTimer").GetComponent <Text>();
     nameone = GameObject.Find("SHIPNAME").GetComponent <Text>();
     crew1   = GameObject.Find("Crew2Text").GetComponent <Text>();
     crew2   = GameObject.Find("Crew1Text").GetComponent <Text>();
     cmui    = GameObject.Find("Crew Members bg").GetComponent <CrewMemberUI>();
     cs      = GameObject.Find("Crew Member").GetComponent <CrewSlot>();
     pr      = GameObject.Find("Pilot Reader").GetComponent <PilotReader>();
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;
     }
     else
     {
         instance = this;
     }
     DontDestroyOnLoad(this.gameObject);
 }