Inheritance: MonoBehaviour
Ejemplo n.º 1
0
 // wird vor Startfunktion einmalig ausgeführt
 void Awake()
 {
     anim   = GetComponent <Animator>(); // Komponente vom Typ Animator
     Vatter = GameObject.FindGameObjectWithTag("MainCamera");
     gLogic = Vatter.GetComponent <GameLogic>();
     gui    = Vatter.GetComponent <GUIScript>();
 }
Ejemplo n.º 2
0
    //public CharacterController charController;

    // Use this for initialization
    void Start()
    {
        gm = (GameMode)gameModeObject.GetComponent(typeof(GameMode));
        gs = (GUIScript)guiObject.GetComponent(typeof(GUIScript));
        //		GetComponent<AudioSource> ().playOnAwake = false;
        //		GetComponent<AudioSource> ().clip = bump;
    }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     bunnies = GameObject.FindGameObjectsWithTag("Rabbit");
     cm      = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraMove>();
     pos     = 0;
     g       = gameObject.GetComponent <GUIScript>();
 }
Ejemplo n.º 4
0
 /* Start & Update */
 void Start()
 {
     mainGUI = this.GetComponent<GUIScript>();
     this.CurrentCursor = CURSOR.STANDARD;
 //    UpdateManager.OnUpdate += DoUpdate;
     UpdateManager.OnMouseUpdate += DoUpdate;
 }
Ejemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     soundmanager = GameObject.Find("SoundManager").GetComponent<SoundManager>();
     IntroAnimation = GameObject.Find("IntroAnimation");
     GUIManager = GameObject.Find("GUIManager").GetComponent<GUIScript>();
     soundmanager.PlayAudioClip(soundmanager.IntroBGM, soundmanager.Volum_IntroBGM);
 }
Ejemplo n.º 6
0
    private void OnLevelWasLoaded(int level)
    {
        CmdSpectatorMode(true);

        if (level == 0 && isLocalPlayer)
        {
            canvas             = GameObject.Find("MenuCanvas").GetComponent <GUIScript>();
            canvas.localPlayer = this;
            print(canvas.localPlayer.playerName);
            GameObject[] objects = Resources.FindObjectsOfTypeAll(typeof(GameObject)) as GameObject[];

            for (int i = 0; i < objects.Length; i++)
            {
                if (objects[i].name == "MenuCanvas")
                {
                    canvas = objects[i].GetComponent <GUIScript>();
                    break;
                }
            }
            print(canvas);
            canvas.gameObject.SetActive(true);

            //CmdSendInfo(new PlayerInfo(playerName));
        }

        if (level == 1)
        {
            for (int i = 0; i < panels.Length; i++)
            {
                currPowerups[i] = PowerupType.none;
            }
        }
    }
Ejemplo n.º 7
0
    public void OnMouseDown()
    {
        //access the GUI script to check that the simulation has not been started
        //and the getDoors script to access add/remove doors
        GameObject plane = GameObject.FindGameObjectWithTag("plane");
        script =(GUIScript) plane.GetComponent("GUIScript");
        doorScript =(getDoors) plane.GetComponent("getDoors");
        GameObject door = getDoor(this.name);

        //if the animation has not been started yet and the user has clicked on a door
        //either add or remove door from list of doors
        //change colour to let user know the door has been blocked
        //the check to see if there is at least one door open at all times is done in
        //getDoors script, so no need to check again here
        if (script.start == false && door != null)
            if (check == 1){
                check=0;
                this.renderer.material.color = Color.green;
                this.renderer.material.color -= new Color(0,0,0,.50f);
                doorScript.addDoor(door);
            }
            else {
                if (doorScript.removeDoor(door)){
                check=1;
                this.renderer.material.color = Color.red;
                this.renderer.material.color -= new Color(0,0,0,.50f);
                }
            }
    }
Ejemplo n.º 8
0
    private void Start()
    {
        this.gui         = this.GetComponent <GUIScript>();
        this.gameManager = new GameManager(20, 10);
        this.ai          = new Engine(
            new TetrisAi(
                new TetrisAiWeights
        {
            ColumnTransitions = 0.8024363520000000f,
            LandingHeight     = -0.1958289440000000f,
            NumberOfHoles     = 5.0289489999999999f,
            RowTransitions    = -0.4794300500000000f,
            RowsCleared       = -2.0772042300000000f,
            WellSums          = 0.4410647000000000f
        }));

        this.Blocks = new GameObject[20][];
        for (var i = 0; i < 20; i++)
        {
            this.Blocks[i] = new GameObject[10];
        }

        for (var row = this.gameManager.BoardManager.GameBoard.GetLength(0) - 1; row >= 0; row--)
        {
            for (var column = 0; column < this.gameManager.BoardManager.GameBoard[row].Length; column++)
            {
                var cube = Instantiate(this.Cube);
                cube.transform.position  = new Vector3(column / 2f, row / 2f, 0);
                this.Blocks[row][column] = cube;
            }
        }

        this.LeftWall.transform.position  = new Vector3(-0.4f, 4.5f);
        this.RightWall.transform.position = new Vector3(10f / 2f, 4.5f);
    }
Ejemplo n.º 9
0
    public static void PlayerTurn(int playerNumber)
    {
        GUIScript.LogStatus("Player {0} turn", playerNumber);
        var cardSelect = GameObject.FindObjectOfType <CardSelectScript>();

        cardSelect.canDrawCards = CardDrawPerTurn;
    }
Ejemplo n.º 10
0
    // Use this for initialization
    void Start()
    {
        socket       = (Socket)FindObjectOfType(typeof(Socket));
        guiContoller = (GUIScript)FindObjectOfType(typeof(GUIScript));
        expoUser.SetActive(true);
        userList.Add(expoUser);
        bool cont  = true;
        int  limit = 10;

        numUsers = guiContoller.seat;

        //GameObject.Find("ExpoCyber").SetActive(true);

        if (numUsers == 0)
        {
            GameObject.Find("Canvas").transform.Find("EndButton").gameObject.SetActive(true);
            cam.gameObject.SetActive(true);
        }
        else
        {
            GameObject.Find("Canvas").transform.Find("OutButton").gameObject.SetActive(true);
        }

        if (numUsers > 0)
        {
            int rowAux = 0;
            do
            {
                if (numUsers / 10 < 1)
                {
                    limit = numUsers % 10;
                    limit++;
                    cont = false;
                }
                int aux = 0;
                for (int i = 1; i < limit; i++)
                {
                    int        seat = (rowAux != 0) ? rowAux * 10 + i : i;
                    GameObject user = (GameObject)Instantiate(prefab);
                    user.name = "user" + seat;

                    if (i % 2 == 0)
                    {
                        user.transform.position = userPos[0] + new Vector3((float)0.9 * -aux, (float)0.487 * rowAux, (float)-0.979 * rowAux);
                    }
                    else
                    {
                        user.transform.position = userPos[0] + new Vector3((float)0.9 * aux, (float)0.487 * rowAux, (float)-0.979 * rowAux);
                        aux++;
                    }
                    userSeat.Add(seat);
                    userList.Add(user);
                }
                rowAux++;
                numUsers -= 9;
            } while (cont);

            GameObject.Find("user" + guiContoller.seat).transform.FindChild("MainCamera").gameObject.SetActive(true);
        }
    }
Ejemplo n.º 11
0
    public void OnMouseDown()
    {
        //access the GUI script to check that the simulation has not been started
        //and the getDoors script to access add/remove doors
        GameObject plane = GameObject.FindGameObjectWithTag("plane");

        script     = (GUIScript)plane.GetComponent("GUIScript");
        doorScript = (getDoors)plane.GetComponent("getDoors");
        GameObject door = getDoor(this.name);

        //if the animation has not been started yet and the user has clicked on a door
        //either add or remove door from list of doors
        //change colour to let user know the door has been blocked
        //the check to see if there is at least one door open at all times is done in
        //getDoors script, so no need to check again here
        if (script.start == false && door != null)
        {
            if (check == 1)
            {
                check = 0;
                this.renderer.material.color  = Color.green;
                this.renderer.material.color -= new Color(0, 0, 0, .50f);
                doorScript.addDoor(door);
            }
            else
            {
                if (doorScript.removeDoor(door))
                {
                    check = 1;
                    this.renderer.material.color  = Color.red;
                    this.renderer.material.color -= new Color(0, 0, 0, .50f);
                }
            }
        }
    }
Ejemplo n.º 12
0
 // Use this for initialization
 void Start()
 {
     bunnies = GameObject.FindGameObjectsWithTag("Rabbit");
     cm = GameObject.FindGameObjectWithTag("MainCamera").GetComponent<CameraMove>();
     pos = 0;
     g = gameObject.GetComponent<GUIScript>();
 }
Ejemplo n.º 13
0
 /* Start & Update */
 void Start()
 {
     mainGUI            = this.GetComponent <GUIScript>();
     this.CurrentCursor = CURSOR.STANDARD;
     //    UpdateManager.OnUpdate += DoUpdate;
     UpdateManager.OnMouseUpdate += DoUpdate;
 }
Ejemplo n.º 14
0
 // Use this for initialization
 void Start()
 {
     if (musicPlayer != null)
     {
         musicScript = musicPlayer.GetComponent <MusicPlayerScript>();
     }
     if (mainCamera != null)
     {
         cameraControl = mainCamera.GetComponent <CameraFollow2D> ();
     }
     if (Boss != null)
     {
         bossControl          = Boss.GetComponent <BossScript> ();
         bossEnter            = Boss.GetComponent <MoveScript> ();
         bossCollider         = Boss.GetComponent <PolygonCollider2D> ();
         bossControl.enabled  = false;
         bossEnter.enabled    = false;
         bossCollider.enabled = false;
     }
     if (GUI != null)
     {
         guiScript = GUI.GetComponent <GUIScript> ();
     }
     entranceCountdown = -11;
 }
 private void Init()
 {
     enemyStats         = GameObject.FindGameObjectWithTag("Enemy").GetComponent <EnemyPokemonHandler>();
     playerStats        = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerPokemonHandler>();
     gui                = GameObject.FindGameObjectWithTag("GUIScripts").GetComponent <GUIScript>();
     attack_Switch_Case = GameObject.FindGameObjectWithTag("Attacks").GetComponent <Attack_Switch_Case>();
 }
Ejemplo n.º 16
0
    void Start()
    {
        cam = Camera.main.GetComponent <CameraFade>();
        cam.OnFadeOutCompleted += FadeOutCompleted;

        if (!GetComponent <GUIText>().text.StartsWith("["))
        {
            GetComponent <GUIText>().text = "[" + GetComponent <GUIText>().text;
        }
        if (!GetComponent <GUIText>().text.EndsWith("]"))
        {
            GetComponent <GUIText>().text = GetComponent <GUIText>().text + "]";
        }

        GetComponent <GUIText>().text = GetComponent <GUIText>().text.ToUpper();

        originalText = GetComponent <GUIText>().text;

        guiScript = Functions.GetComponentInGameObject <GUIScript>("GUI");

        gameObject.AddComponent <AudioSource>();
        gameObject.AddComponent <AdjustSoundEffectLevel>();

        clicked = false;
    }
Ejemplo n.º 17
0
    void Start()
    {
        panels = new GameObject[3];
        DontDestroyOnLoad(gameObject);

        server.GetComponent <reallyimportantplayerIDscript>().AddPlayer();
        playerID = server.GetComponent <reallyimportantplayerIDscript>().playerCount;
        if (isLocalPlayer)
        {
            RoomProperties.localPlayer = gameObject;
            //CmdChooseColor();
        }

        //Transferred from the old PlayerLobby Script
        if (SceneManager.GetActiveScene().name == "Menu")
        {
            canvas = GameObject.Find("MenuCanvas").GetComponent <GUIScript>();
            if (isLocalPlayer)
            {
                print("I MADE IT YES");
                canvas.localPlayer = this;
                playerName         = playerID.ToString();
                CmdSetName(playerName);
                CmdSendInfo(new PlayerInfo(playerName));
                print(playerName);
            }
        }

        if (isServer)
        {
            print("Start");
            //InvokeRepeating("CmdPositionCorretions", 0f, invokeRepeatRate);
        }
    }
Ejemplo n.º 18
0
    // Update is called once per frame
    void Update()
    {
        if (GUIScript.GetGameOn() == true)
        {
            LarsX = transform.position.x;               // Gets Larses current X coordinates
            LarsZ = transform.position.z;               // Gets Larses current Z coordinate

            // The following code will make our character move with the a,w,d,s or arrow keys and make him face in that direction
            if (Input.GetKey(KeyCode.A) || Input.GetKey(KeyCode.LeftArrow))
            {
                transform.position   += new Vector3(-3.0f, 0, 0) * Time.deltaTime;
                transform.eulerAngles = new Vector3(0, 270, 0);
            }
            if (Input.GetKey(KeyCode.D) || Input.GetKey(KeyCode.RightArrow))
            {
                transform.position   += new Vector3(3.0f, 0, 0) * Time.deltaTime;
                transform.eulerAngles = new Vector3(0, 90, 0);
            }
            if (Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.UpArrow))
            {
                transform.position   += new Vector3(0, 0, 3f) * Time.deltaTime;
                transform.eulerAngles = new Vector3(0, 0, 0);
            }
            if (Input.GetKey(KeyCode.S) || Input.GetKey(KeyCode.DownArrow))
            {
                transform.position   += new Vector3(0, 0, -3f) * Time.deltaTime;
                transform.eulerAngles = new Vector3(0, 180, 0);
            }
            // This statement will make Lars shot a ball of fire
            if (Input.GetKeyDown(KeyCode.Space) && BallIsReady == true)
            {
                Instantiate(Spawn, transform.position + transform.forward, Quaternion.identity);
                BallIsReady = false;
            }

            // This following code will make a timer for the cooldown for when Lars can fire another ball of fire (so he can't spam them)
            if (BallIsReady == false)
            {
                BallCoolDown--;                 // When a ball of fire have been fired off will this variable cound down each frame until it reaches 0
                if (BallCoolDown == 0)
                {
                    BallIsReady  = true;                        // A new ball can then be fired again
                    BallCoolDown = 48;                          // And the timer resets to 2 seconds
                }
            }

            // Lars shall not be able to stack too much HP, this will set the cap so he can't reach over his maximum HP
            if (HeroHP > MaxHP)
            {
                HeroHP = MaxHP;
            }

            // If Lars's HP becomes 0 or below then will he be destroyed
            if (HeroHP <= 0)
            {
                Destroy(gameObject);
            }
        }
    }
 // Use this for initialization
 void Start()
 {
     anim = GetComponent <Animator>();
     gui  = GameObject.Find("Main Camera").GetComponent <GUIScript>();
     btn  = GameObject.Find("Main Camera").GetComponent <ButtonsScript>();
     currentPhysicalDamages = currentStrength;
     ChangeAP(0);
 }
Ejemplo n.º 20
0
    // Use this for initialization
    void Start()
    {
        GameObject guiCanvas = GameObject.Find("GUI");

        guiScript = guiCanvas.GetComponent <GUIScript>();
        roads     = new List <GameObject>(GameObject.FindGameObjectsWithTag("Road").OrderBy(go => go.name)).ToArray();
        hpBar     = transform.Find("HPbar").gameObject;
    }
Ejemplo n.º 21
0
    private void Start()
    {
        script         = SceneGlobals.ui_script;
        add_menu       = script.add_group_menu;
        player_control = SceneGlobals.Player.Object.GetComponent <ShipControl>();

        arrow_size_slider = GameObject.Find("arrow_size").GetComponent <Slider>();
    }
Ejemplo n.º 22
0
 void Start()
 {
     Screen.lockCursor = true;
     unit = GameObject.Find("Cube");
     CS = unit.GetComponent<GUIScript>();
     //un = unit.GetComponent<unitScript>();
     camtar = GameObject.Find("camtar").transform;
 }
 void Start()
 {
     maincamera = GameObject.Find("Main Camera");
     guiScript = maincamera.GetComponent<GUIScript>();
     soundManager = GameObject.Find("SoundManager").GetComponent<SoundManager>();
     shieldScript = GameObject.Find("l_arm").GetComponent<ShieldScript>();
     swordScript = GameObject.Find("r_arm").GetComponent<SwordScript>();
 }
Ejemplo n.º 24
0
    public void StartGame()
    {
        startButton.enabled = false;
        startButton.GetComponentInChildren <CanvasGroup>().alpha = 0;
        GUIScript.LogStatus("Starting game");
        var charSelect = GameObject.FindObjectOfType <CharSelectScript>();

        charSelect.InitCharSelect();
    }
Ejemplo n.º 25
0
    void Awake()
    {
        if (Instance != null)
        {
            Debug.LogError("More than one instance of GUIScript being created!");
        }

        Instance = this;
    }
Ejemplo n.º 26
0
    public static void StartRound(int playerNumber)
    {
        GUIScript.LogStatus("Starting round");
        var charSelect = GameObject.FindObjectOfType <CharSelectScript>();

        charSelect.FlopUnselectedChars();
        // TODO: Set players turns
        PlayerTurn(playerNumber);
    }
Ejemplo n.º 27
0
    void Awake()
    {
        if (Instance != null)
        {
            Debug.LogError("More than one instance of GUIScript being created!");
        }

        Instance = this;
    }
Ejemplo n.º 28
0
 // Use this for initialization
 void Start()
 {
     tempID     = Random.Range(0, 151);
     attackData = GameObject.FindGameObjectWithTag("AttackData").GetComponent <PokemonAttacks>();
     pokeDex    = GameObject.FindGameObjectWithTag("Library").GetComponent <PokemonLibrary>();
     gif        = this.GetComponent <GifRenderer>();
     gui        = GameObject.FindGameObjectWithTag("GUIScripts").GetComponent <GUIScript>();
     tc         = GameObject.FindGameObjectWithTag("TurnController").GetComponent <TurnController>();
     Init();
 }
Ejemplo n.º 29
0
    void StartNewGame()
    {
        enemyInfo = new PlayerHelper(this, "Comp");
        ps        = new PlayerHelper(this, "Human");
        ps.SetTheEnemy(enemyInfo);
        enemyInfo.SetTheEnemy(ps);
        GUIScript guiS = new GUIScript(ps, enemyInfo);

        PushCardOnDeck(new Vector3());
    }
Ejemplo n.º 30
0
    // Start is called before the first frame update
    void Start()
    {
        guiScript = GameObject.Find("Main Camera").GetComponent <GUIScript>();

        stars    = new GameObject[5];
        stars[0] = GameObject.Find("Star1");
        stars[1] = GameObject.Find("Star2");
        stars[2] = GameObject.Find("Star3");
        stars[3] = GameObject.Find("Star4");
        stars[4] = GameObject.Find("Star5");
    }
Ejemplo n.º 31
0
    public void animation_update()
    {
        GameObject guibar = GameObject.Find("GUI - Bar");

        gui_instance = guibar.GetComponent<GUIScript>();

        float bps = gui_instance.beats_per_second;
        reflected_bps = bps;

        bino.animation["running"].speed = 1.6f * bps;
    }
Ejemplo n.º 32
0
 void Start()
 {
     //cam.SetActive(false);
     //w = Screen.width; h = Screen.height;
     height = Mathf.RoundToInt(h / 100 * 8);
     offsetBetweenHearts = Mathf.RoundToInt(((float)w / 100.0f) / 2.0f);
     width = height;
     //width = 3 * height;
     instance = this;
     //curTexture = textures[2];
 }
Ejemplo n.º 33
0
 void Start()
 {
     //cam.SetActive(false);
     //w = Screen.width; h = Screen.height;
     height = Mathf.RoundToInt(h / 100 * 8);
     offsetBetweenHearts = Mathf.RoundToInt(((float)w / 100.0f) / 2.0f);
     width = height;
     //width = 3 * height;
     instance = this;
     //curTexture = textures[2];
 }
Ejemplo n.º 34
0
    public void PacmanLoseLife()
    {
        lives--;
        gameState = GameState.Dead;

        // update UI too
        GUIScript ui = GameObject.FindObjectOfType <GUIScript>();

        Destroy(ui.lives[ui.lives.Count - 1]);
        ui.lives.RemoveAt(ui.lives.Count - 1);
    }
Ejemplo n.º 35
0
    // Use this for initialization
    void Start()
    {
        GameObject temp = GameObject.Find("player_prefab");
        thePlayer = temp.GetComponent<player_class>();
        combos = temp.GetComponent<combo_master>();

        GameObject temp2 = GameObject.Find("GUI - Bar");
        tolerance = temp2.GetComponent<GUIScript>();

        GameObject temp3 = GameObject.Find("Director");
        theDirector = temp3.GetComponent<Director>();
    }
Ejemplo n.º 36
0
 void Start()
 {
     rect           = GetComponent <RectTransform>();
     gui_script     = SceneGlobals.ui_script;
     player_script  = SceneGlobals.Player.control_script;
     source_button  = GameObject.Find("turr_slide");
     mask_transform = GetComponentInChildren <RectMask2D>().transform;
     slider         = GetComponentInChildren <Slider>();
     tgt_choice     = GameObject.Find("TG_selecter").GetComponent <Dropdown>();
     ammo_choice    = GameObject.Find("Ammo_selecter").GetComponent <Dropdown>();
     name_input     = GetComponentInChildren <InputField>();
 }
 void OnGUI()
 {
     // This one will show the number of apple seeds the player have collected
     if (GUIScript.GetGameOn() == true)
     {
         GUI.Label(new Rect(40, 80, 200, 100), "<size=40>" + Lars.GetPoints() + "</size>");
     }
     if (GUI.Button(new Rect(10, 10, 100, 50), "Quit"))
     {
         Application.Quit();
     }
 }
Ejemplo n.º 38
0
 public void FlopUnselectedChars()
 {
     foreach (var characterObj in this.charsObjs)
     {
         var charScript = characterObj.GetComponent(typeof(CharacterScript)) as CharacterScript;
         if (!charScript.isSelected)
         {
             GUIScript.LogStatus("Char {0} flipped", charScript.charType);
             characterObj.SetActive(false);
         }
     }
 }
Ejemplo n.º 39
0
 // Use this for initialization
 void Start()
 {
     if (neck == null)
     {
         guiController = (GUIScript)FindObjectOfType(typeof(GUIScript));
         userObject    = GameObject.Find("user" + guiController.seat);
         neck          = userObject.transform.Find("Armature").gameObject.transform.Find("Hips").gameObject;
         neck          = neck.transform.Find("Spine").gameObject.transform.Find("Chest").gameObject;
         neck          = neck.transform.Find("Neck").gameObject.transform.Find("Head").gameObject;
     }
     neck.transform.rotation = Quaternion.Euler(this.transform.localEulerAngles.x, this.transform.localEulerAngles.y, this.transform.localEulerAngles.z);
 }
Ejemplo n.º 40
0
 private void Awake()
 {
     if (instance = null)
     {
         instance = this;
     }
     GameOver  = false;
     GameClear = false;
     //点数表示用のテクストを探す
     _pointNum = GameObject.FindGameObjectsWithTag("GoalPoint").Length;
     _pointText.GetComponent <Text>().text = " X " + point + " / " + _pointNum;
     _gui = GetComponent <GUIScript>();
 }
Ejemplo n.º 41
0
    //private SelectorScript SelectionSprite;
    //public static bool CameraChanged = false;

    /* Properties */

    /* Start & Update */
    void Start()
    {
        mainGUI = this.GetComponent<GUIScript>();
        MouseMove = this.gameObject.AddComponent<MouseMovement>();
        UpdateManager.OnUpdate += DoUpdate;

        // Get SelectionRectangle
        /*foreach (GameObject rectangle in GameObject.FindGameObjectsWithTag("Rectangles"))
        {
            if (rectangle.gameObject.name == "SelectionRectangle")
            {
                SelectionSprite = rectangle.GetComponent<SelectorScript>();
                break;
            }
        }*/
    }
Ejemplo n.º 42
0
    // Use this for initialization
    void Start()
    {
        AttackList = new List<GameObject>();
        GUI = GameObject.Find("GUI").GetComponent<GUIScript>();
        hitableEnemies = new List<GameObject>();
          //  Time.timeScale = 0.5f;
        LstSquQuadRegr solvr = new LstSquQuadRegr();
        solvr.AddPoints(0, 0);
        solvr.AddPoints(MaxCharge, 1);
        solvr.AddPoints(2 * MaxCharge, 0);
        a = (float)solvr.aTerm();
        b = (float)solvr.bTerm();
        c = (float)solvr.cTerm();

        print("a: " + a + ", b: " + b + ", c: " + c);
    }
Ejemplo n.º 43
0
    // Use this for initialization
    void Start()
    {
        gridLoader = GameObject.FindGameObjectWithTag("GameController").GetComponent<GridLoader>();
        guiScript = GameObject.FindGameObjectWithTag("GameController").GetComponent<GUIScript>();
        cameraComponent = this.GetComponent<Camera>();
        simulationScript = GameObject.FindGameObjectWithTag("GameController").GetComponent<SimulationScript>();

        //This determines how the mouse direction is mapped to movements in the 3d space
        right = new Vector3(1,0,-1).normalized;
        upward = new Vector3(1,0,1).normalized;

        groundPlane = new Plane(new Vector3(0,1,0), new Vector3(0,0,0));

        mode = "panning";
        meteorSelect.renderer.enabled = false;

        shakeTime = 0.0f;
    }
Ejemplo n.º 44
0
    //when an object collides with a door
    void OnTriggerStay(Collider other)
    {
        GameObject plane = GameObject.FindGameObjectWithTag("plane");
        script =(GUIScript) plane.GetComponent("GUIScript");

        //since the passengers have 2 colliders, to enable some of them to give
        //priority whenever they collide with another passenger, this script will register
        //every collision, making that 2 / passenger
        //the check below is to ensure every collision is registered once
        if (!other.isTrigger){
            if (this.gameObject.name == "DoorFL") script.updateEvacFL();
            else if (this.gameObject.name == "DoorFR") script.updateEvacFR();
            else if (this.gameObject.name == "DoorBL") script.updateEvacBL();
            else if (this.gameObject.name == "DoorBR") script.updateEvacBR();
            else if (this.gameObject.name == "DoorML1") script.updateEvacML1();
            else if (this.gameObject.name == "DoorML2") script.updateEvacML2();
            else if (this.gameObject.name == "DoorMR1") script.updateEvacMR1();
            else if (this.gameObject.name == "DoorMR2") script.updateEvacMR2();
            other.gameObject.SetActive(false);
        }
    }
Ejemplo n.º 45
0
	void Start ()
    {
        view = camera.pixelRect;
        mainGUI = GUIScript.main.GetComponent<GUIScript>();
	    buildingBuilder = GameObject.FindGameObjectWithTag("ScriptContainer").GetComponent<BuildingBuilder>();

        buttonSIDEstyle.fontSize = buttonStyle.fontSize = (int)((float)buttonStyle.fontSize * ScaleX);
        guiStyle.fontSize = (int)((float)guiStyle.fontSize * ScaleX);
        guiSIDEstyle.fontSize = (int)((float)guiSIDEstyle.fontSize * ScaleX);
        guiStyle.border.left = (int)(-1.62f * ScaleX);
        guiStyle.border.right = (int)(-3.25f * ScaleX);
        guiStyle.border.top = (int)(20.5f * ScaleY);
        guiStyle.border.bottom = (int)(20.5f * ScaleY);
        guiStyle.padding.top = (int)(-15f*ScaleX);
        guiStyle.padding.left = (int)(23.79f * ScaleX);
        guiStyle.overflow.top = (int)(-6.3f * ScaleY);
        guiStyle.overflow.bottom = (int)(9.5 * ScaleY);

        buttonSIDEstyle.fixedWidth *= ScaleX;
        buttonSIDEstyle.fixedHeight *= ScaleY;

        //UnitPosition = new Vector2(GUIScript.ScreenSize.x - 100, 130);
	}
Ejemplo n.º 46
0
	void Start ()
    {
        this.mainGUI = GUIScript.main.GetComponent<GUIScript>();
        this.IsSignedIn = false;
        gameObject.renderer.enabled = false;
	}
 // Use this for initialization
 void Start()
 {
     GameObject gui = Utilities.FindGameObject("GUI");
     if(gui != null) guiScript = gui.GetComponent<GUIScript>();
 }
 void Start()
 {
     guiScript = GameObject.Find("Main Camera").GetComponent<GUIScript>();
 }
Ejemplo n.º 49
0
    // Use this for initialization
    void Start()
    {
        sockets = new Sockets();
        client = new Client();
        opPosY = 128;
        ballPosX = 0;
        ballPosY = 0;
        buffer = new byte[6];
        gameStart = false;
        player1Score = 0;
        player2Score = 0;

        gui = GameObject.Find("GUI").GetComponent<GUIScript>();

        p1 = (Player1) GameObject.Find ("Player1").GetComponent ("Player1");
        p2 = (Player2) GameObject.Find ("Player2").GetComponent ("Player2");
        bscript = (BallScript) GameObject.Find ("GameBall").GetComponent("BallScript");
        lPaddle = GameObject.Find ("Goal2");
        bWall = GameObject.Find ("BottomWall");
        paddleRatio = (250.0f / (GameObject.Find("Goal1").transform.position.x - GameObject.Find("Goal2").transform.position.x));
        wallRatio = (250.0f / (GameObject.Find ("TopWall").transform.position.y - bWall.transform.position.y));
    }
	// Use this for initialization
	void Start () {
	
		gs = GUIMenu.GetComponent<GUIScript>();
		gt = this.GetComponent<GUIText>();
	}
 // Use this for initialization
 void Start()
 {
     tempID = Random.Range(0, 151);
     attackData = GameObject.FindGameObjectWithTag("AttackData").GetComponent<PokemonAttacks>();
     pokeDex = GameObject.FindGameObjectWithTag("Library").GetComponent<PokemonLibrary>();
     gif = this.GetComponent<GifRenderer>();
     gui = GameObject.FindGameObjectWithTag("GUIScripts").GetComponent<GUIScript>();
     tc = GameObject.FindGameObjectWithTag("TurnController").GetComponent<TurnController>();
     Init();
 }
Ejemplo n.º 52
0
    // Use this for initialization
    void Start()
    {
        controller = this.GetComponent<KinectPointController>();
        camera = GameObject.Find("CameraRight");
        GameObject guiTutorial = GameObject.Find ("GUI-Tutorial");
        if (guiTutorial != null) tutorialScript = guiTutorial.GetComponent<Tutorial> ();
        GameObject gui = Utilities.FindGameObject("GUI");
        if(gui != null) guiScript = gui.GetComponent<GUIScript>();
        hip = controller.Hip_Center;

        //KinectPointController
        startPos = this.transform.position;
        speed = 0.0f;
    }
Ejemplo n.º 53
0
 void Start()
 {
     //------Retrive External Scripts------\\
     moveScript = gameObject.GetComponent<PlayerMove>();
     guiScript = GameObject.Find("GUI").gameObject.GetComponent<GUIScript>();
 }
Ejemplo n.º 54
0
    // Use this for initialization
    void Start()
    {
        if (ObstacleController.PLAYER != null)
        {
            hm = ObstacleController.PLAYER.GetComponent<HeroMovement>();
            anim = ObstacleController.PLAYER.GetComponent<Animator>();
            anim.SetInteger("AttackState", 0);
            anim.SetLayerWeight(1, 1);
            anim.SetLayerWeight(2, 1);
            anim.SetLayerWeight(3, 1);
        }
        attackAnimCountdown = 0f;
        AttackList = new List<GameObject>();
        GUI = Camera.mainCamera.GetComponent<GUIScript>();
        hitableEnemies = new List<GameObject>();
        //  Time.timeScale = 0.5f;
        LstSquQuadRegr solvr = new LstSquQuadRegr();
        solvr.AddPoints(0, 0);
        solvr.AddPoints(MaxCharge / 2, 1);
        solvr.AddPoints(MaxCharge, 0);
        a = (float)solvr.aTerm();
        b = (float)solvr.bTerm();
        c = (float)solvr.cTerm();

        //print("a: " + a + ", b: " + b + ", c: " + c);
    }
Ejemplo n.º 55
0
 // Use this for initialization
 void Start()
 {
     foreach (CapsuleCollider rs in this.gameObject.GetComponentsInChildren<CapsuleCollider>())
     {
         rs.isTrigger = true;
     }
     foreach (BoxCollider rs in this.gameObject.GetComponentsInChildren<BoxCollider>())
     {
         rs.isTrigger = true;
     }
     foreach (SphereCollider rs in this.gameObject.GetComponentsInChildren<SphereCollider>())
     {
         rs.isTrigger = true;
     }
     foreach (Rigidbody rs in this.gameObject.GetComponentsInChildren<Rigidbody>())
     {
         rs.Sleep();
     }
     currentSpeed = MoveSpeed;
     dead = false;
     defaultRot = transform.rotation;
     complete = false;
     anim = gameObject.GetComponent<Animator>();
     GUI = Camera.mainCamera.GetComponent<GUIScript>();
     am = GameObject.Find("FellowHeroes").GetComponent<ArmyMovement>();
     ha = gameObject.GetComponent<HeroAttack>();
 }
Ejemplo n.º 56
0
 void Start()
 {
     GUI = Camera.mainCamera.GetComponent<GUIScript>();
 }
Ejemplo n.º 57
0
 void Start()
 {
     gui = GameObject.FindGameObjectWithTag ("GUI").GetComponent<GUIScript>();
     navAgent = GetComponent<NavMeshAgent>();
     player = GameObject.FindGameObjectWithTag("Player");
     NotificationCenter.DefaultCenter.AddObserver(this, "InvisibilityTriggered");
 }
Ejemplo n.º 58
0
 void Awake()
 {
     main = this.gameObject.GetComponent<GUIScript>();
 }
Ejemplo n.º 59
0
 /*//inventory problem
  *
  * * * geen idee
  * GUI melding
  * het oppakken
  *
  * * * komt waarschijnlijk door het new keyword en hoe ik door de list ga
  *
  * adden aan intory array
  * aan de list adden(melding new key word)
  */
 void Start()
 {
     Gui = GetComponent<GUIScript>();
 }
Ejemplo n.º 60
0
    void Start()
    {
        gui = (GUIScript)GameObject.Find ("GUIScript").GetComponent (typeof(GUIScript));
        cessna = (CessnaScript)GameObject.Find ("Cessna").GetComponent (typeof(CessnaScript));
        bus = (BusScript) GameObject.Find ("Bus").GetComponent (typeof(BusScript));

        score = 0;
        state = "putRunway";
    }