void Awake()
 {
     if (_instance != null)
     {
         Debug.Log("Instance already exists!");
         return;
     }
     _instance = this;
     //gazeFollower = GetComponent<Transform>();
 }
Пример #2
0
    public Sprite visorClosed; //closed visor sprite

	//init
	void Start () {
		//objects
		theVisorInsideView = GameObject.FindWithTag(TAG_VISOR_INSIDEVIEW); //visor inside view game object in scene
        theVisorRechargeView = GameObject.FindWithTag(TAG_VISOR_RECHARGEVIEW); //visor recharge view game object in scene
        theVisorRechargeView.transform.position = new Vector3(theVisorRechargeView.transform.position.x - VISOR_OFFSET_UNITS_INIT, theVisorRechargeView.transform.position.y, theVisorRechargeView.transform.position.z); //offset initial position for recharge view (to align left charging, rather than center)

        //properties
        //audio
        sfxVisorFullEnabled = true;

		//scripts
        theRecharge = GetComponent<Recharge>(); //get recharge script attached to object
        theGazeMove = GetComponent<GazeMove>(); //get gazemove script attached to object

	} //end function
Пример #3
0
    public Sprite visorClosed; //closed visor sprite

    //init
    void Start()
    {
        //objects
        theVisorInsideView   = GameObject.FindWithTag(TAG_VISOR_INSIDEVIEW);                                                                                                                                              //visor inside view game object in scene
        theVisorRechargeView = GameObject.FindWithTag(TAG_VISOR_RECHARGEVIEW);                                                                                                                                            //visor recharge view game object in scene
        theVisorRechargeView.transform.position = new Vector3(theVisorRechargeView.transform.position.x - VISOR_OFFSET_UNITS_INIT, theVisorRechargeView.transform.position.y, theVisorRechargeView.transform.position.z); //offset initial position for recharge view (to align left charging, rather than center)

        //properties
        //audio
        sfxVisorFullEnabled = true;

        //scripts
        theRecharge = GetComponent <Recharge>(); //get recharge script attached to object
        theGazeMove = GetComponent <GazeMove>(); //get gazemove script attached to object
    }                                            //end function
Пример #4
0
    //init
    void Start()
    {
        //debug
        debugOn = false; //default to off

        //properties
        currentLevel = 0;     //initial level
        isGameOver   = false; //initial flag

        //objects
        theCam            = Camera.main;                                 //main camera in scene
        theGame           = GameObject.FindWithTag(TAG_GAME);            //game manager object in scene
        theDimView        = GameObject.FindWithTag(TAG_DIMVIEW);         //dim view game object in scene
        theVisor          = GameObject.FindWithTag(TAG_VISOR);           //visor object in scene
        theVisorFrameView = GameObject.FindWithTag(TAG_VISOR_FRAMEVIEW); //visor frame view object in scene
        theTargets        = GameObject.FindWithTag(TAG_TARGETS);         //targets game object container in scene
        theTutorial       = GameObject.FindWithTag(TAG_TUTORIAL);        //tutorial game object container in scene

        //scripts
        theBounds = theGame.AddComponent <Bounds>();                 //add new bounds script
        theData   = theGame.AddComponent <GazeDataManager>();        //add new data manager script
        theWave   = theGame.AddComponent <Wave>();                   //add new wave script
        theVisorRechargeScript = theVisor.GetComponent <Recharge>(); //visor recharge script
        theVisorGazeMoveScript = theVisor.GetComponent <GazeMove>(); //visor gazemove script

        //init tutorial wave
        //a single target that must be destroyed to advance
        theWave = theWave.waveWithPrefabParentLimits(target_00, theTargets, 1, 1, 0);

        //update score
        ScoreManager.Instance.resetScore();

        UnityEngine.Debug.Log("[GameManager] Starting the game!");

        //transition into scene via state manager
        if (StateManager.Instance != null)
        {
            TransitionFade theTransition = StateManager.Instance.gameObject.GetComponent <TransitionFade>();
            theTransition.toggleFade();
        }

        //audio
        if (AudioManager.Instance != null)
        {
            AudioManager.Instance.toggleFade();
        }
    }      //end function
Пример #5
0
	//init
	void Start () {
        
        //debug
        debugOn = false; //default to off

        //properties
        currentLevel = 0; //initial level
        isGameOver = false; //initial flag

        //objects
        theCam = Camera.main; //main camera in scene
        theGame = GameObject.FindWithTag(TAG_GAME); //game manager object in scene
        theDimView = GameObject.FindWithTag(TAG_DIMVIEW); //dim view game object in scene
		theVisor = GameObject.FindWithTag(TAG_VISOR); //visor object in scene
        theVisorFrameView = GameObject.FindWithTag(TAG_VISOR_FRAMEVIEW); //visor frame view object in scene
        theTargets = GameObject.FindWithTag(TAG_TARGETS); //targets game object container in scene
        theTutorial = GameObject.FindWithTag(TAG_TUTORIAL); //tutorial game object container in scene

		//scripts
		theBounds = theGame.AddComponent<Bounds>(); //add new bounds script
		theData = theGame.AddComponent<GazeDataManager>(); //add new data manager script
        theWave = theGame.AddComponent<Wave>(); //add new wave script
		theVisorRechargeScript = theVisor.GetComponent<Recharge>(); //visor recharge script
        theVisorGazeMoveScript = theVisor.GetComponent<GazeMove>(); //visor gazemove script

        //init tutorial wave
        //a single target that must be destroyed to advance
        theWave = theWave.waveWithPrefabParentLimits(target_00, theTargets, 1, 1, 0);

        //update score
        ScoreManager.Instance.resetScore();
        
        UnityEngine.Debug.Log("[GameManager] Starting the game!");

        //transition into scene via state manager
        if (StateManager.Instance != null) {
            TransitionFade theTransition = StateManager.Instance.gameObject.GetComponent<TransitionFade>();
            theTransition.toggleFade();
        }

        //audio
        if (AudioManager.Instance != null) {
            AudioManager.Instance.toggleFade();
        }

	}  //end function