예제 #1
0
    public void Start()
    {
        Server = GameObject.Find("Server").GetComponent <ServerPretend>();

        if (NewDatabaseAndClearOld)
        {
            Server.EmptyDatabase();
        }
        else
        {
            Server.GET();
        }

        //get all the GameObjects needed on start
        Error    = GameObject.Find("ErrorWindow");
        Window   = GameObject.Find("MainMenu/Window");
        ErrorMsg = Error.transform.GetChild(0).GetComponent <Text>();
        //set error window to inactive
        Error.SetActive(false);
    }
예제 #2
0
    /*
     *  void Awake()
     *  {
     *          DontDestroyOnLoad(transform.gameObject);
     *          if (FindObjectsOfType(GetType()).Length > 1){
     *                  Destroy(gameObject);
     *          }
     *  }*/

    // Use this for initialization
    void Start()
    {
        Server = GameObject.Find("Server").GetComponent <ServerPretend>();
        Client = GameObject.Find("Player").GetComponent <Player>();

        Server.GET();

        //A. Update credits on docking to station.
        Server.UpdateCredits(Client.GetUserName(), Client.GetCredits());


        //AllShipsInGUI = GameObject.FindGameObjectsWithTag("DisableGroup");
        RentedShip       = Client.GetRentedShipName();
        WaitListedShip   = Client.GetWaitListedShipName();
        RentedShipGuiBox = "none";

        GameObject.Find("CurrentShip").GetComponentInChildren <DropMe>().ResetImage();
        AllShipsInGUI = GameObject.FindGameObjectsWithTag("DisableGroup");

        UpdateDockingStation(false);
        Client.SetShipRented(RentedShip, GetSelectedShip(), true);
    }