Beispiel #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);
            }
        }
    }
 void Start()
 {
     transform.localScale = new Vector3(app.gameRefModel.bombBlastRadius, app.gameRefModel.bombBlastRadius, app.gameRefModel.bombBlastRadius);
     realtimeView         = GetComponent <RealtimeView>();
     if (realtimeView.isOwnedLocallyInHierarchy)
     {
         GetComponent <RealtimeTransform>().RequestOwnership();
     }
     Invoke("SelfDestruct", 1.0f);
 }
Beispiel #3
0
    // Start is called before the first frame update
    void Start()
    {
        lr = GetComponent <LineRenderer>();
        rb = GetComponent <Rigidbody>();
        _realtimeTransform = GetComponent <RealtimeTransform>();
        _realtimeView      = GetComponent <RealtimeView>();

        started = false;
        frame   = 0;
    }
 void Start()
 {
     GetComponent <ParticleSystem>().Play();
     Debug.Log("particle played");
     realtimeView = GetComponent <RealtimeView>();
     if (realtimeView.isOwnedLocallyInHierarchy)
     {
         GetComponent <RealtimeTransform>().RequestOwnership();
     }
     Invoke("SelfDestruct", 4.8f);
 }
        private void Awake()
        {
            // Set physics timestep to 60hz
            Time.fixedDeltaTime = 1.0f / 60.0f;

            // Store a reference to the rigidbody for easy access
            _rigidbody = GetComponent <Rigidbody>();

            // Store a reference to the RealtimeView for easy access
            _realtimeView = GetComponent <RealtimeView>();
        }
Beispiel #6
0
    void Start()
    {
        //slider = GetComponent<Slider>();

        _realtimeView = GetComponent <RealtimeView>();


        _value    = slider.value;
        text.text = _value.ToString();
        // Get a reference to the slider sync component.
        _sliderSync = GetComponent <SliderSync>();
    }
Beispiel #7
0
    private void Start()
    {
        _RealtimeView = GetComponent <RealtimeView>();

        transform.name = _RealtimeView.ownerID.ToString();

        _integerSync = GetComponent <IntegerSync>();

        if (_RealtimeView.isOwnedLocally)
        {
            isOwnedLocally = true;
        }
    }
Beispiel #8
0
    void Start()
    {
        _realtimeView = GetComponent <RealtimeView>();

        if (_realtimeView.isOwnedLocally)
        {
            // Local player avatar, let's create a blarp!
            GameObject playerBlarpGameObject = Realtime.Instantiate(blarpPrefab.name, true, true, true);
            blarp = playerBlarpGameObject.GetComponent <PullTowardsHand>();


            GameObject playerBlarpGameObject1 = Realtime.Instantiate(shieldPrefab.name, true, true, true);
            shield = playerBlarpGameObject1.GetComponent <Paddle>();
        }
    }
    void Start()
    {
        //Attaches local components and events
        myBoatView   = GetComponent <BoatView>();
        realtimeView = GetComponent <RealtimeView>();
        NetworkSyncManager.OnNetworkTurnUpdate      += BoatActiviation;
        NetworkSyncManager.OnNetworkGameStateUpdate += GameStart;
        if (realtimeView.isOwnedLocallyInHierarchy)
        {
            GetComponent <RealtimeTransform>().RequestOwnership();
        }
        myBoatView.turnHighlighter.SetActive(false);

        //Assigns boat to the correct team and updates the team model
        if (myTeamColor == GameRefModel.BoatColors.Yellow)
        {
            myTeam = app.gameRefModel.yellowTeamModel;
        }
        if (myTeamColor == GameRefModel.BoatColors.Red)
        {
            myTeam = app.gameRefModel.redTeamModel;
        }
        myTeam.boatList.Add(gameObject);
        myTeam.UpdateBoatCount();

        //Done just for this boat
        if (realtimeView.isOwnedLocallyInHierarchy)
        {
            //Instantiates and stores the PlanController
            myBoatPlan = Instantiate(planPrefab, transform.position, Quaternion.identity);
            plan       = myBoatPlan.GetComponent <PlanController>();
            myBoatPlan.SetActive(false);
            myBoatView.turnHighlighter.SetActive(false);
            BoatActiviation(app.networkSyncManager.currentTurnStateNumber, app.networkSyncManager.currentSyncedTurnColor);
            plan.myTeamModel = myTeam;
        }

        //bombIcon = GameObject.FindGameObjectWithTag("bombIcon");
        //mineIcon = GameObject.FindGameObjectWithTag("mineIcon");
        //anchorIcon.SetActive(false);

        /*if (localReferee.startWithForcefields)
         * {
         *  forceField.SetActive(true);
         * }*/
    }
Beispiel #10
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);
 }
Beispiel #11
0
    void OnCollisionEnter(Collision c)
    {
        RealtimeView rtv = c.collider.gameObject.GetComponent <RealtimeView>();

        if (rtv != null)
        {
            if (rtv.isOwnedLocally == true)
            {
                rtTransform.RequestOwnership();
                rtView.RequestOwnership();
                transform.position = Random.insideUnitSphere + new Vector3(0, 1, 0);
                scorer.NewScore();
            }
            else
            {
                print("NOT OWNED LOCALLY");
            }
        }
    }
Beispiel #12
0
    void Start()
    {
        realtimeView = GetComponent <RealtimeView>();
        _brokenWrapper.SetActive(false);

        _shardsLocalRotation = _shards[0].localRotation;
        GetBrokenLocalPositions();

        ShowRegularHead();

        if (!_isDummy)
        {
            int ownerID = realtimeView.ownerID;
            player = ownerID == 0 ? AttackingPlayer.one : AttackingPlayer.two;

            if (realtimeView.isOwnedLocally)
            {
                _eyes.SetActive(false);
            }
        }
    }
Beispiel #13
0
 void Start()
 {
     human = GetComponent <Human>();
     view  = GetComponent <RealtimeView>();
 }
Beispiel #14
0
 // Start is called before the first frame update
 private void Start()
 {
     _realtimeView      = gameObject.GetComponent <RealtimeView>();
     _realtimeTransform = gameObject.GetComponent <RealtimeTransform>();
 }
Beispiel #15
0
 // Start is called before the first frame update
 void Start()
 {
     bob  = gameObject.GetComponent <RealtimeTransform>();
     bill = gameObject.GetComponent <RealtimeView>();
 }
Beispiel #16
0
 // Start is called before the first frame update
 void Start()
 {
     rtTransform = gameObject.GetComponent <RealtimeTransform>();
     rtView      = gameObject.GetComponent <RealtimeView>();
 }
Beispiel #17
0
 private void Awake()
 {
     _realtimeView      = GetComponent <RealtimeView>();
     _realtimeTransform = GetComponent <RealtimeTransform>();
 }
Beispiel #18
0
 private void Start() {
     _realtimeView = GetComponent<RealtimeView>();
 }
Beispiel #19
0
 void Start()
 {
     view = GetComponent <RealtimeView>();
     realtimeTransform = GetComponent <RealtimeTransform>();
 }
    private void Awake()
    {
        currentInstance = this;

        realtimeView = GetComponent <RealtimeView>();
    }