Пример #1
0
 public override void Initialize()
 {
     base.Initialize ();
     crewmanager = transform.root.GetComponent<CrewManager> ();
     spawnPoint = transform.FindChild("DeployPoint");
     rallyPoint = transform.FindChild("RallyPoint");
     dockedunits = transform.FindChild("DockedUnits").gameObject;
     units = transform.root.FindChild ("Units").gameObject;
     initialized = true;
 }
Пример #2
0
 public void Awake()
 {
     cm = this;
     Engineer = new CrewMember();
     Engineer.initialize("Toby", CrewMember.CrewRole.Engineer, CrewMember.BackgroundInfo.Duster);
     Pilot = new CrewMember();
     Pilot.initialize("Jim", CrewMember.CrewRole.Pilot, CrewMember.BackgroundInfo.Gun);
     Gunner = new CrewMember();
     Gunner.initialize("Tim", CrewMember.CrewRole.Gunner, CrewMember.BackgroundInfo.Traderunner);
     Scientist = new CrewMember();
     Scientist.initialize("Larry", CrewMember.CrewRole.Scientist, CrewMember.BackgroundInfo.Duster);
 }
Пример #3
0
 void Awake()
 {
     // Need to set the singleton in Awake, to make sure that other scripts can access them
     // after their Awake functions are done
     if (S == null)
     {
         S = this;
     }
     else
     {
         Destroy(this);
     }
 }
Пример #4
0
    private void Awake()
    {
        // Dont destroy this object when a new scene is loaded, unless...
        DontDestroyOnLoad(this);

        // There can be only ONE!
        if (_instance == null)
        {
            _instance = this;
        }
        else if (_instance != this)
        {
            Destroy(this.gameObject);
        }
    }
Пример #5
0
 public override void Initialize()
 {
     crewmanager = GetComponent<CrewManager> ();
     crewpanel = (GameObject) Resources.Load ("Prefabs/UI/CrewPanel");
     shippanel = (GameObject) Resources.Load ("Prefabs/UI/ShipPanel");
     Canvas canvas = transform.FindChild ("CrewManagementCanvas").GetComponent<Canvas>();
     crewbuttonorganizer = canvas.transform.FindChild ("Left Panel").GetComponent<ButtonOrganizer> ();
     postbuttonorganizer = canvas.transform.FindChild ("Right Panel").GetComponent<ButtonOrganizer> ();
     dockedunits = GameObject.FindGameObjectWithTag ("Mothership").transform.FindChild("DockedUnits").gameObject;
     foreach(GameObject g in GameObject.FindGameObjectsWithTag("Canvas")){
         g.SetActive(false); //set all other canvases inactive to be sure there aren't multiple active
     }
     canvas.gameObject.SetActive (true); //activate the canvas we want
     guicrewlist = crewmanager.mastercrewlist;//get a local copy
     DisplayCrew();
     DisplayShips ();
 }
Пример #6
0
 void Start()
 {
     crewManager = CrewManager.S;
 }
Пример #7
0
    //public GameObject expBar;

    public void Start()
    {
        instance = this;
        players  = new Player[4];
    }
Пример #8
0
 public CrewSlot(PositionType position)
 {
     //constructor
     assignedposition = position;
     crewmanager = GameObject.FindGameObjectWithTag("Player1").GetComponent<CrewManager> (); //because it's not "on" a gameobject, you can't use root like I'd like.
 }