Beispiel #1
0
    void Awake()
    {
        lvlCtrl  = GetComponent <LevelControl>();
        camCtrl  = GetComponent <CameraControl>();
        playCtrl = GetComponent <PlayoutControl>();

        netManCtrl = GetComponent <NetworkManagerControl>();
        rCmdCtrl   = GetComponent <RobotCommandControl>();
    }
Beispiel #2
0
    void Awake()
    {
        gameCtrl   = GetComponent <GameControl>();
        netManCtrl = GetComponent <NetworkManagerControl>();
        rCmdCtrl   = GetComponent <RobotCommandControl>();
        lvlCtrl    = GetComponent <LevelControl>();

        guiCanvas = GameObject.Find("GUICanvas").transform;
        foreach (Transform child in guiCanvas)
        {
            if (child.name.Equals("CurrRobotPanel"))
            {
                robotPanel = child;

                foreach (Transform gChild in child)
                {
                    if (gChild.name.Equals("MovesLeftText"))
                    {
                        movesLeftText = gChild.GetComponent <Text>();
                    }
                    else if (gChild.name.Equals("RobotNameText"))
                    {
                        robotNameText = gChild.GetComponent <Text>();
                    }
                    else if (gChild.name.Equals("ShootModeButton"))
                    {
                        shootModeButton = gChild.GetComponent <Button>();
                    }
                }
            }
            else if (child.name.Equals("GeneralInfoPanel"))
            {
                generalInfoPanel = child;

                foreach (Transform gChild in child)
                {
                    if (gChild.name.Equals("TurnText"))
                    {
                        turnText = gChild.GetComponent <Text>();
                    }
                }
            }
            else if (child.name.Equals("RobotPlacingPanel"))
            {
                robotPlacingPanel = child;
                foreach (Transform gChild in robotPlacingPanel)
                {
                    if (gChild.name.Equals("FirstRobotPosition"))
                    {
                        firstRobotPosition = gChild;
                    }
                }
            }
        }

        robotPanel.gameObject.SetActive(false);
    }
Beispiel #3
0
    void Start()
    {
        RobotCommandControl rCmdCtrl = GameObject.Find("GameScripts").GetComponent <RobotCommandControl>();

        if (!rCmdCtrl.controlledRobots.Contains(robot))
        {
            enabled = false;
        }

        lastX = (int)transform.position.x;
        lastY = (int)transform.position.y;
    }
Beispiel #4
0
    //PLAYER
    void Init(int playerId, int robotID)
    {
        robName       = "Robot " + (robotID + 1);
        this.playerId = playerId;

        hp = initHP;

        this.robotID = robotID;
        needPlacing  = true;

        robotCommand = new RobotCommand(robotID);

        rCmdCtrl = GameObject.Find("GameScripts").GetComponent <RobotCommandControl>();
        gameCtrl = GameObject.Find("GameScripts").GetComponent <GameControl>();
        rCmdCtrl.AddRobot(this);
    }
Beispiel #5
0
    void Awake()
    {
        netView  = GetComponent <NetworkView>();
        gameCtrl = GetComponent <GameControl>();
        rCmdCtrl = GetComponent <RobotCommandControl>();
        camCtrl  = GetComponent <CameraControl>();
        guiCtrl  = GetComponent <GameGUIControl>();
        fogCtrl  = GetComponent <DarknessFogControl>();

        lvlLoadCtrl = GameObject.Find("LevelLoadingControl").GetComponent <LevelLoadingControl>();
//		GameObject[] networkPlayersObjs = GameObject.FindGameObjectsWithTag("NetworkPlayer");
//		playerCount = networkPlayersObjs.Length;
//		Debug.Log("networkPlayersObjs length: "  + networkPlayersObjs.Length + ", netPlayers[0]: " + netPlayers[0]);
//
//		for (int i = 0; i < networkPlayersObjs.Length; i++) {
////			netPlayers[i] = networkPlayersObjs[i].GetComponent<NetworkPlayerInfo>();
//		}
    }