コード例 #1
0
        public override void UpdateTowerAttrributes(RpcArgs args)
        {
            OwnerFaction = args.GetNext <string>();
            GPSCoords    = networkObject.towerGPSCoords;
            //Update tower position on network
            transform.position = networkObject.towerNetPosition;
            ActivateBoxColliders(true);//This call isn't necessary for the towers on the network but we don't care

            //Find GameEntityRegister
            GameEntityRegister = FindObjectOfType <GameEntityRegister>();

            //Add this tower controller to the register
            GameEntityRegister.AddEntity(this);

            //Register the callback for deleting the Destination controller from the register when it will disconnect
            networkObject.onDestroy += NetworkObject_onDestroyRemoveFromRegister;
        }
コード例 #2
0
        protected void UpdateDestinationAttributes(string _playerName,
                                                   string _selectedUma,
                                                   Color _cursorColor,
                                                   Vector3 _cursorsDimension)
        {
            //Change the name of the gameObject and make it visible in the editor
            PlayerName      = _playerName;
            SelectedUma     = _selectedUma;
            gameObject.name = PlayerName;

            //Assign the color/dimension of the cursor and make it visible in the editor
            cursorColor = _cursorColor;
            sphereRend.material.color   = _cursorColor;
            sphere.transform.localScale = _cursorsDimension;

            //Find GameEntityRegister
            GameEntityRegister = FindObjectOfType <GameEntityRegister>();

            //Add this Destination controller to the register
            GameEntityRegister.AddEntity(this);

            //Register the callback for deleting the Destination controller from the register when it will disconnect
            networkObject.onDestroy += NetworkObject_onDestroyRemoveFromRegister;
        }