void Start()
 {
     weapnDropsGOList   = new List <GameObject>();
     weaponDropPosList  = new List <Vector3>();
     weaponDropTypeList = new List <WeaponType>();
     FindAllWeaponDrops();
     SpawnAllWeaponDrops();
     player_Controller = transform.parent.GetComponentInChildren <Player_Controller>();
 }
示例#2
0
 private void Awake()
 {
     GameObject[] player = GameObject.FindGameObjectsWithTag("Player");
     if (player.Length == 1)
     {
         controller = player[0].GetComponentInChildren <Player_Controller>();
     }
     else
     {
         Debug.Log("More then one object with player tag");
     };
 }
示例#3
0
        private void Start()
        {
            GameObject[] players = GameObject.FindGameObjectsWithTag("Player");
            if (players.Length == 1)
            {
                player = players[0].GetComponentInChildren <Player_Controller>();
            }
            else
            {
                Debug.Log("More then one object with player tag");
            };

            GameObject[] cursors = GameObject.FindGameObjectsWithTag("Cursor");
            if (cursors.Length == 1)
            {
                cursor = cursors[0].GetComponentInChildren <Player_Cursor>();
            }
            else
            {
                Debug.Log("More then one object with cursor tag");
            };

            CameraScript[] cameraScripts = GetComponentsInChildren <CameraScript>();
            if (cameraScripts.Length == 2)
            {
                foreach (CameraScript cameraScript in cameraScripts)
                {
                    if (cameraScript.gameObject.name == "Camera_Play")
                    {
                        camera_Play = cameraScript;
                    }
                    else if (cameraScript.gameObject.name == "Camera_PauseMenu")
                    {
                        camera_PauseMenu = cameraScript;
                    }
                    else
                    {
                        Debug.Log("Camera not found");
                    }
                }
            }
            else
            {
                Debug.Log("There should only be " + 2 + " cameras");
            };

            useCamera(cameraHeld);

            transform.position = player.transform.position;
        }
示例#4
0
        private void Start()
        {
            GameObject[] players = GameObject.FindGameObjectsWithTag("Player");
            if (players.Length == 1)
            {
                player = players[0].GetComponentInChildren <Player_Controller>();
            }
            else
            {
                Debug.Log("More then one object with player tag");
            };

            GameObject[] cameraGrips = GameObject.FindGameObjectsWithTag("MainCamera");
            if (cameraGrips.Length == 1)
            {
                cameraGrip = cameraGrips[0].GetComponentInChildren <CameraGrip>();
            }
            else
            {
                Debug.Log("More then one object with cameraGrips tag");
            };
        }