Example #1
0
 private void OnEnable()
 {
     if (GameSetupController.GS == null)
     {
         GameSetupController.GS = this;
     }
 }
Example #2
0
        private void Start()
        {
            if (Server == null)
            {
                Server = FindObjectOfType <ServerController> ();
            }
            if (GameUI == null)
            {
                GameUI = FindObjectOfType <GameUIController> ();
            }
            if (GameSetup == null)
            {
                GameSetup = FindObjectOfType <GameSetupController> ();
            }

            BackBtn.onClick.AddListener(GoBack);

            // Hosting path.
            HostGameBtn.onClick.AddListener(ActivateHostRoomUI);
            HostRoomBtn.onClick.AddListener(HostRoom);
            ConfirmBtn.onClick.AddListener(FailToCreateRoomConfirm);

            // Joining path.
            JoinGameBtn.onClick.AddListener(ActivateViewRoomsUI);

            Initialize();
        }
Example #3
0
        void Start()
        {
            // PhotonNetwork.connectionState = new ConnectionState();
            //dbgDoConnect = false;
            roomOptions = new RoomOptions()
            {
                MaxPlayers = 10
            };

            roomOptions.CustomRoomPropertiesForLobby = new string[1] {
                "GPS"
            };

            if (MainMenuUI == null)
            {
                MainMenuUI = FindObjectOfType <MainMenuUIController> ();
            }
            if (GameUI == null)
            {
                GameUI = FindObjectOfType <GameUIController> ();
            }
            if (GameSetup == null)
            {
                GameSetup = FindObjectOfType <GameSetupController> ();
            }

            PhotonNetwork.Disconnect();

            IsHost       = false;
            GPSThreshold = 0.01f;
            StartCoroutine(StartLocationService());
        }
Example #4
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Example #5
0
    void Start()
    {
        // playerTransform = this.parent.transform;
        gameSetup = GameObject.Find("GameSetup").GetComponent <GameSetupController>();
        GameObject obj = this.transform.parent.gameObject;

        myPV = obj.GetComponent <PhotonView>();
    }
Example #6
0
 void Awake()
 {
     GSC = transform.GetComponent <GameSetupController>();
     if (GSC == null)
     {
         Debug.Log("Network Player Couldn't find GameSetupController  ");
     }
 }
Example #7
0
 // Start is called before the first frame update
 void Start()
 {
     gameSetup = GameObject.Find("GameSetup").GetComponent <GameSetupController>();
     myPV      = GetComponent <PhotonView>();
     if (myPV.IsMine)
     {
         Camera.main.transform.SetParent(this.transform);
     }
 }
 void Start()
 {
     //Looks for GameSetupController as long as were in a game and NOT in Menu
     if (SceneManager.GetActiveScene().name != "Menu")
     {
         GSC = GameObject.Find("GameSetupController").GetComponent <GameSetupController>();
         if (GSC == null)
         {
             Debug.Log("Network Player Couldn't find GameSetupController  ");
         }
     }
 }
Example #9
0
        void Start()
        {
            CurrentHealth    = FullHealth;
            transform.parent = GameController.WorldRootObject.transform;
            GameController.RegisterPlayer(this);
            gameObject.transform.GetChild(0).gameObject.SetActive(false);

            if (GameSetup == null)
            {
                GameSetup = FindObjectOfType <GameSetupController> ();
            }
        }
Example #10
0
 void Start()
 {
     if (Server == null)
     {
         Server = FindObjectOfType <ServerController> ();
     }
     if (GameSetup == null)
     {
         GameSetup = FindObjectOfType <GameSetupController> ();
     }
     shotBtn = ShotBtn.GetComponent <Button> ();
     FinishMappingBtn.onClick.AddListener(MappingStop);
     StartGameBtn.onClick.AddListener(StartGame);
     MainMenuBtn.onClick.AddListener(GoToMainMenu);
     OpenMenuBtn.onClick.AddListener(ToggleGameMenu);
 }
Example #11
0
    void SyncPositOfPlatform(int nonMasterViewID)
    {
        Debug.Log("SyncPositOfPlatform");
        PhotonView nonMaster = PhotonView.Find(nonMasterViewID);

        if (nonMaster != null)
        {
            GameSetupController nonMasterGameSetupController = nonMaster.GetComponent <GameSetupController>();
            Debug.Log($"NonMstr Posit: {nonMasterGameSetupController.transform.position}");
            Debug.Log($"Mstr Posit: {platform.transform.position}");
            nonMasterGameSetupController.platform.transform.position = platform.transform.position;
        }
        else
        {
            Debug.LogError($"{pView.ViewID}: nonMaster PhotonView is Null");
        }
    }
Example #12
0
    public IEnumerator ReSpawnCO(int sec)
    {
        running = true;
        GameSetupController gameSetupController = GameObject.FindObjectOfType <GameSetupController>();

        Player.SetActive(false);
        Vector3 newpos = gameSetupController.RandomPointinArea(gameSetupController.SpawnArea_CenterPoint.position, Vector3.up, gameSetupController.SpawnArea_Radius);

        Player.transform.position = newpos;
        UIManager.Instance._respawn.SetActive(true);
        for (int i = sec; i > 0; i--)
        {
            UIManager.Instance._respawn.transform.GetChild(0).GetComponent <TextMeshProUGUI>().text = "Respawn in " + i;
            yield return(new WaitForSeconds(1));
        }
        Player.SetActive(true);
        Player.GetComponent <PlayerStats>().Health = 100;
        UIManager.Instance._respawn.SetActive(false);

        running = false;
    }
Example #13
0
    private void Awake()
    {
        //Looks for GameSetupController as long as were in a game and NOT in Menu
        if (SceneManager.GetActiveScene().name != "Menu")
        {
            GSC = GameObject.Find("GameSetupController").GetComponent <GameSetupController>();
            if (GSC == null)
            {
                Debug.Log("Network Player Couldn't find GameSetupController  ");
            }
        }

        //Assigning various components/GameObj's to vars for use
        photonView = transform.GetComponent <PhotonView>();
        PFC        = GameObject.Find("NetworkController").GetComponent <PlayFabsController>();
        animator   = GetComponentInChildren <Animator>();
        playerCustomizeChildOBJ = animator.gameObject;
        //target = transform.Find("CameraPivot/Target");

        if (PFC != null && GSC != null)
        {
            Playeraccessory = PFC.Playeraccessory;
            playerHat       = PFC.playerHat;
            playerTop       = PFC.playerTop;
            playerJacket    = PFC.playerJacket;
            playerUnderware = PFC.playerUnderware;
            playerHead      = PFC.playerHead;
            playerSkin      = PFC.playerSkin;
            playerBottom    = PFC.playerBottom;
            playerShoes     = PFC.playerShoes;
            playerSex       = PFC.playerSex;
            playerID        = PFC.myID;
        }
        else
        {
            Debug.Log("Network Player Couldn't find PlayFabsController ");
        }
    }
Example #14
0
    private void Awake()
    {
        GSC        = this;
        photonView = GetComponent <PhotonView>();

        maxSnowballs = 15;
        xArea        = 13.0f; //Area for sb spawns (+/- xArea)
        zArea        = 4.0f;
        spawnWait    = 1.0f;  //time between sb spawns
        startWait    = 0.0f;  //time before sb start spawning

        if (level == 101)
        {
            matchLength = 60; //90
        }
        else if (level == 102)
        {
            matchLength = 30; //30
        }
        else
        {
            matchLength = 120; //120sec default time
        }
    }
Example #15
0
 private void Start()
 {
     // Starts the timer automatically
     gameSetup      = GameObject.Find("GameSetup").GetComponent <GameSetupController>();
     timerIsRunning = true;
 }
Example #16
0
 private void Start()
 {
     // m_SpriteRenderer = GetComponent<SpriteRenderer>();
     mText     = GetComponent <TextMeshPro>();
     gameSetup = GameObject.Find("GameSetup").GetComponent <GameSetupController>();
 }