Esempio n. 1
0
    void Start()
    {
        NetworkSyncManager.OnNetworkTurnUpdate += PrepairTeamForTurn;
        realtime       = FindObjectOfType <Realtime>();
        realtimeView   = GetComponent <RealtimeView>();
        globalTurnSync = FindObjectOfType <NetworkSyncManager>();
        InstantiateTimer();
        LoadMine();
        LoadBomb();
        DisplayPlacard();
        if (realtimeView.isOwnedLocallyInHierarchy)
        {
            app.gameRefModel.localTeamModel = teamData;

            //mine setup
            teamData.totalMines = app.gameRefModel.startingMines;
            if (teamData.teamColor == GameRefModel.BoatColors.Yellow)
            {
                app.uiView.yellowMineText.text = "" + teamData.totalMines;
                app.uiView.yellowMineInventory.SetActive(true);
            }
            if (teamData.teamColor == GameRefModel.BoatColors.Red)
            {
                app.uiView.redMineText.text = "" + teamData.totalMines;
                app.uiView.redMineInventory.SetActive(true);
            }
        }
    }
Esempio n. 2
0
 // Start is called before the first frame update
 void Awake()
 {
     gameRefModel       = FindObjectOfType <GameRefModel>();
     gameRefController  = FindObjectOfType <GameRefController>();
     networkSyncManager = FindObjectOfType <NetworkSyncManager>();
     terrainController  = FindObjectOfType <TerrainController>();
     realtime           = FindObjectOfType <Realtime>();
 }
Esempio n. 3
0
 // Start is called before the first frame update
 void Start()
 {
     EventManager.OnTurnUpdate += InstantiateTimer;
     _realtime      = FindObjectOfType <Realtime>();
     globalTurnSync = FindObjectOfType <NetworkSyncManager>();
     if (globalTurnSync.currentSyncedTurn == 0 && (int)boatColor == 0)
     {
         personalTimer = Realtime.Instantiate(prefabName: "YellowTimer", ownedByClient: true, preventOwnershipTakeover: true, useInstance: _realtime);
     }
     else if (globalTurnSync.currentSyncedTurn == 1 && (int)boatColor == 1)
     {
         personalTimer = Realtime.Instantiate(prefabName: "RedTimer", ownedByClient: true, preventOwnershipTakeover: true, useInstance: _realtime);
     }
 }
Esempio n. 4
0
 void Start()
 {
     boatPath        = GetComponent <LineRenderer>();
     boatRigid       = GetComponent <Rigidbody>();
     _realtimeView   = GetComponent <RealtimeView>();
     _realtime       = FindObjectOfType <Realtime>();
     _globalTurnSync = FindObjectOfType <NetworkSyncManager>();
     if (_realtimeView.isOwnedLocallyInHierarchy)
     {
         GetComponent <RealtimeTransform>().RequestOwnership();
         highlighter.SetActive(true);
     }
     else
     {
         highlighter.SetActive(false);
     }
     //localRef = FindObjectOfType<GameRef>();
     //localRef.AddToBoatList(gameObject, boatColor);
 }
Esempio n. 5
0
 void Start()
 {
     _globalTurnSync = FindObjectOfType <NetworkSyncManager>();
 }
Esempio n. 6
0
 // Start is called before the first frame update
 void Start()
 {
     globalTurnSync  = FindObjectOfType <NetworkSyncManager>();
     timerRenderer   = GetComponent <Renderer>();
     currentDuration = turnDuration;
 }
Esempio n. 7
0
 void Start()
 {
     localTurnSync = GetComponent <NetworkSyncManager>();
     localRenderer = GetComponent <Renderer>();
     //EventManager.OnTurnUpdate += UpdateTurnDisplay;
 }
Esempio n. 8
0
 private void Awake()
 {
     Instance = this;
     InitCustomProperties();
 }