void CheckSceneRequirements()
    {
        if (SceneManager.GetActiveScene().buildIndex == 0 && !AddGoatCam)   //resets attributes of goat controls (in main menu)
        {
            AddGoatCam          = true;
            PlayerControlActive = false;
        }

        if (SceneManager.GetActiveScene().buildIndex == 1 && AddGoatCam)    // adds goat to camera script (in main game)
        {
            AddGoatToCam();
            AddGoatCam = false;
            camOBJ     = Camera.main.GetComponent <Camera_Shake>();
            DisablePlayerControl(false);

            for (int i = 0; i < bodyVisibility.Length; i++)
            {
                bodyVisibility[i].SetActive(true);
            }
        }
        if (!rankingAquired && instance.gotRankings && SceneManager.GetActiveScene().buildIndex == 1)
        {
            rankingAquired = true;
        }
    }
Exemple #2
0
 void Start()
 {
     movement             = transform.parent.gameObject.GetComponent <Player_Movement>();
     cam_shaker           = transform.parent.gameObject.GetComponent <Camera_Shake>();
     carController        = transform.parent.gameObject.GetComponent <Car_Controller>();
     lapCheckPointCount   = 0;
     totalCheckPointCount = 0;
     playerNumber         = carController.playerNumber;
 }
Exemple #3
0
    void Start()
    {
        //_mat = mat.GetComponent<Renderer>().material;
        source         = GetComponent <AudioSource>();
        shake          = camera.GetComponent <Camera_Shake>();
        blood          = GetComponentsInChildren <ParticleSystem>();
        handleDC       = GetComponent <HandleDamageColliders>();
        handleAnim     = GetComponent <HandleAnimations>();
        handleMovement = GetComponent <HandleMovement>();
        //blood = GetComponentInChildren<ParticleSystem>();



        spare = false;
        mercy = false;
    }
Exemple #4
0
 // Use this for initialization
 void Start()
 {
     c    = Camera.main.GetComponent <Camera_Shake>();
     rb   = GetComponent <Rigidbody2D>();
     hurt = GetComponent <AudioSource>();
 }