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*/;
    }
Example #2
0
 // Use this for initialization
 public override void Initialize()
 {
     base.Initialize ();
     crewslots = new CrewSlot[positionarray.Length];
     occupiedarray = new bool[positionarray.Length];
     for(int i = 0; i < positionarray.Length; i++) {
         crewslots [i] = new CrewSlot (positionarray[i]);//make a new slot with the right position
         crewslots[i].parentobject = this.gameObject;
     }
     occupiedarray = new bool[positionarray.Length];
     if (parentunit != null) {
         parentunit.crewcabin = this;
     }
 }
 // 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);
 }
Example #4
0
 public void UpdateCrewAssignments(Crew crew, CrewSlot crewslot)
 {
     crewassignments[crew] = crewslot;
     Debug.Log(crew.firstName + " " + crew.lastName + " is now assgined to "+crewslot);
 }