示例#1
0
    void Start()
    {
        /* Initialize the error list */
        errors = new List <string>();

        /* Make sure the GUI Skin is set */
        if (this.myGUISkin == null)
        {
            addDebug("Please assign a GUIskin on the editor!");
            this.enabled = false;
            return;
        }

        /* Set the U/I fields to defaults */
        /* TODO: This needs to be completed */
        expandGUI      = true;
        worldName      = "MiddleEarth";
        worldPassword  = "******";
        playerName     = "";
        playerPassword = "";
        secretcode     = "";

        /* Get the hooks to the other elements of the environment */
        /* TODO: This needs to be completed */
        checkNetworkHelper();
        checkMyLocation();
        checkMyGyroController();

        /* set the initial location */
        /* TODO: This needs to be completed */
        lastLat = myLocation.getLat();
        lastLng = myLocation.getLng();
        lastAlt = myLocation.getAlt();

        /* set initial leaders */
        leaders = "";

        /* Set the camera components to initial values */
        fracJourney = 0.0f;
        destination = new Vector3(myLocation.getLng(), myLocation.getAlt() + 20, myLocation.getLat());
        origin      = new Vector3(camera.transform.position.x, camera.transform.position.y, camera.transform.position.z);


        /* Add a few default colors */
        /* TODO: This needs to be completed (optional) */
    }
示例#2
0
    void Start()
    {
        /* Initialize the error list */
        errors = new List <string> ();

        /* Make sure the GUI Skin is set */
        if (this.myGUISkin == null)
        {
            addDebug("Please assign a GUIskin on the editor!");
            this.enabled = false;
            return;
        }

        /* Set the U/I fields to defaults */
        expandGUI      = true;
        worldName      = "MiddleEarth";
        worldPassword  = "******";
        playerName     = "k";
        playerPassword = "******";
        secretcode     = "secret";

        /* Get the hooks to the other elements of the environment */
        camera = GameObject.Find("Main Camera");
        checkNetworkHelper();
        checkMyLocation();
        checkMyGyroController();

        /* set the initial location */
        lastLng = myLocation.getLng();
        lastLat = myLocation.getLat();
        lastAlt = myLocation.getAlt();

        /* Set the camera components to initial values */
        fracJourney = 0.0f;
        destination = new Vector3(myLocation.getLng(), myLocation.getAlt() + 20, myLocation.getLat());
        origin      = new Vector3(camera.transform.position.x, camera.transform.position.y, camera.transform.position.z);

        /* Add a few default colors */
        ownerColors.Add("barbarian", new Color(0.3f, 0.3f, 0.3f, 0.7f));
        ownerColors.Add("k", new Color(0.0f, 0.0f, 1.0f, 0.7f));
    }