void Awake() { if (instance == null) { InitializeEnemysPerLevel(); AudioSource[] sources = GetComponents <AudioSource>(); soundMusicSource = sources[0]; soundEffectsSource = sources[1]; LoadSounds(); LoadSoundsVolumes(); saveTimes = 0; level = 1; redAlienSpeed = 0; currency = 0; DontDestroyOnLoad(gameObject); instance = this; } else if (instance != this) { Destroy(gameObject); } }
override public void StartUp() { string lvlname = "Main"; GlobalGameController.LoadLevel(lvlname); Debug.Log("Loaded Scene"); }
// Use this for initialization protected virtual void Start() { globalGameController = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <GlobalGameController>(); controlledUnit = gameObject.GetComponentInChildren <UnitsBase>(); unitCollider = controlledUnit.GetComponent <Collider>(); pawnController = GetComponent <CharacterController>(); isEncumbered = false; }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { gameController = animator.gameObject.GetComponent <GlobalGameController>(); tutorialRoomCanvas = gameController.TutorialRoomPanel; key = GameObject.Find("I_Key01"); character = GameObject.Find("PlayerCharacter"); keyPosition = new Vector2(key.transform.localPosition.x, key.transform.localPosition.y); paused = false; }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { gameController = animator.gameObject.GetComponent <GlobalGameController>(); tutorialRoomCanvas = gameController.TutorialRoomPanel; character = GameObject.Find("PlayerCharacter"); tutorialRoomCanvas.transform.Find("PickupObject").gameObject.SetActive(true); paused = false; }
void Start() { #if UNITY_EDITOR if (GameObject.FindObjectOfType <HMD.CameraSetup>() == null) { GlobalGameController.LoadLevel(0); } #endif GameObject.Destroy(gameObject); }
// Use this for initialization void Start() { if (instance == null) { instance = this; } else { Destroy(gameObject); } ResetScoresAndLives(); DontDestroyOnLoad(gameObject); }
public void ChangeStep(TutorialStep nextStep) { if (nextStep != null) { step = nextStep; } else { running = false; GlobalGameController gameController = transform.GetComponent <GlobalGameController>(); ExecuteEvents.Execute <ITutorialEventHandler>(gameObject, null, (handler, eventData) => { handler.TutorialEnded(); }); } }
private bool InitializeInstance() { if (!GlobalGameController.globalInstance) { GlobalGameController.globalInstance = this; } else { Destroy(this.gameObject); return(false); } DontDestroyOnLoad(this.gameObject); return(true); }
public void PlayDigSound() { if (canDigSoundPlay) { if (playerDigSoundChanger) { GlobalGameController.PlaySoundEffect("Dig1"); playerDigSoundChanger = !playerDigSoundChanger; } else { GlobalGameController.PlaySoundEffect("Dig2"); playerDigSoundChanger = !playerDigSoundChanger; } } }
public void PlayDeadSound() { GlobalGameController.PlaySoundEffect("DeadMan"); }
private void Start() { Instance = this; notifications.SetActive(false); }
void Start() { globalGameController = GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent <GlobalGameController>(); cameraRef = globalGameController.playerCameraRef; cameraPos = cameraRef.transform.position; }