void Start()
        {
            GameObject player   = GameObject.FindGameObjectWithTag("Player");
            Transform  gunshell = player.transform.Find("GunWithCamera").Find("GunShell");

            gunShellController = gunshell.gameObject.GetComponent <GunShellController>();
        }
Exemple #2
0
        void Start()
        {
            motionController   = GetComponent <PlayerMotionController>();
            gunShell           = transform.Find("GunWithCamera").Find("GunShell").gameObject;
            gunShellController = gunShell.GetComponent <GunShellController>();
            GameObject mainCamera = GameObject.FindGameObjectWithTag("MainCamera");

            aimPoint = mainCamera.transform.Find("AimPoint");

            GameObject sparkPrefab = Resources.Load <GameObject>("Effects/Spark");

            sparkGameObject = Instantiate(sparkPrefab);
            spark           = sparkGameObject.GetComponent <ParticleSystem>();
        }
 void Start()
 {
     playerAnimator         = GetComponent <Animator>();
     playerMotionController = player.GetComponent <PlayerMotionController>();
     gunShellController     = gunShell.GetComponent <GunShellController>();
 }