private void Awake() { if (instance == null) { instance = this; } }
void Start() { anim = GetComponent<Animator>(); audio = GetComponent<AudioSource>(); collected = false; manager = GameObject.FindGameObjectWithTag("CollectableManager").GetComponent<CollectableManager>(); }
// Start is called before the first frame update void Start() { if (cManager == null) { cManager = GameObject.Find("Managers").GetComponent <CollectableManager>(); } }
void Start() { if (cManager == null && CollectableManager._inst != null) { cManager = CollectableManager._inst; } }
void Start() { //Setting our references m_SFX = SFXManager.Instance; m_CollectableManager = GameObject.FindGameObjectWithTag(Constants.COLLECTABLE_MANAGER).GetComponent<CollectableManager>(); SetOnGround(); }
// Start is called before the first frame update void Start() { if (instance == null) { instance = this; } cheatAllSouls = false; }
void Start() { //Setting our references m_SFX = SFXManager.Instance; m_CollectableManager = GameObject.FindGameObjectWithTag(Constants.COLLECTABLE_MANAGER).GetComponent <CollectableManager>(); SetOnGround(); }
public override void OnStartLocalPlayer() { base.OnStartLocalPlayer(); // set up the variables currentHealth = MAXHEALTH; playerController = GetComponent <PlayerController>(); collectableManager = GameObject.Find("collectableContainer").GetComponent <CollectableManager>(); }
void Start() { // variable setup / initialization isObjectiveComplete = false; generator = GetComponent <CollectableManager>(); generator.Init(); player = Instantiate(playerPrefab, new Vector3(0, 100, 0), Quaternion.identity); player.GetComponent <PlayerController>().levelManager = this; }
// Start is called before the first frame update void Start() { if (instance == null) { instance = this; } gos = GameObject.FindGameObjectsWithTag("Collectable"); numInScene = gos.Length; }
private void Start() { CollectiblesCollected = new List <int>(); originalPos = transform.position; shaker = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraShaker>(); defaultRot = transform.rotation; rb = GetComponent <Rigidbody>(); Manager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <CollectableManager>(); StartCoroutine(Manager.RegisterPlayer(Address, privateKey)); }
private void Awake() { if (_instance != null) { Destroy(gameObject); } else { _instance = this; } }
void Awake() { worldContainer = GameObject.FindGameObjectWithTag("World"); playerCamera = GameObject.FindGameObjectWithTag("PlayerCamera"); player = FindObjectOfType <Player>(); spawner = GetComponent <Spawner>(); enemySpawner = GetComponent <EnemySpawner>(); switchSystem = GetComponent <SwitchSystem>(); collectableManager = GetComponent <CollectableManager>(); }
private void Awake() { if (_instance != null && _instance != this) { Destroy(gameObject); } else { _instance = this; //DontDestroyOnLoad(this.gameObject); } }
void Start() { if (CollectableManager._inst != null) { cManager = CollectableManager._inst; } if (pHandler == null) { pHandler = FindObjectOfType <PlayerStatusHandler>(); } }
void Start() { // Grab our coin manager coinManager = GameObject.FindWithTag("CoinManager").GetComponent <CoinManager> (); // Grab our collectable manager collectableManager = GameObject.FindWithTag("CollectableManager").GetComponent <CollectableManager>(); collectablePanelWindow = GameObject.Find("CollectablePanelWindow"); // Setup the sprite image in the UI itemUIImage.sprite = itemSprite; }
public void Init() { // variable setup / initialization collectableManager = GetComponent <CollectableManager>(); enemyManager = GetComponent <EnemyManager>(); maze = GetComponent <BinaryTreeMaze>(); isObjectiveComplete = false; enemyManager.Init(); collectableManager.Init(); maze.Init(); player.transform.position = new Vector3(1, 2, 1); player.GetComponent <PlayerController>().levelManager = this; }
void Awake() { // Confirm singleton instance is active if (_inst == null) { _inst = this; // DontDestroyOnLoad(this); } else if (_inst != this) { GameObject.Destroy(this.gameObject); } }
// Use this for initialization void Awake() { if (Instance == null) { Instance = this; } else if (Instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); checkpointResults = new List <CheckpointResult>(); }
// Start is called before the first frame update void Start() { nftManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <CollectableManager>(); manager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>(); main = Camera.main.GetComponent <CameraShaker>(); ripple = Camera.main.GetComponent <RipplePostProcessor>(); Kills = GameObject.FindGameObjectWithTag("Score").GetComponent <Text>(); Description = GameObject.FindGameObjectWithTag("Description").GetComponent <Text>(); Name = GameObject.FindGameObjectWithTag("Name").GetComponent <Text>(); player = GameObject.FindGameObjectWithTag("Player"); playerScript = GameObject.FindGameObjectWithTag("Player").GetComponent <Player>(); rb = GetComponent <Rigidbody>(); currentShootTime = maxShootTime; defaultRot = transform.rotation; originalPos = transform.position; health = Random.Range(5, 15); }
//public int NumOfApples { // get { // return numOfApples; // } //} //public int NumOfBreadLoves { // get { // return numOfBreadLoves; // } //} //public int NumOfWood { // get { // return numOfWood; // } //} //public int NumOfMeat { // get { // return numOfMeat; // } //} //Awake is always called before any Start functions void Awake() { //Check if instance already exists if (instance == null) { //if not, set instance to this instance = this; } //If instance already exists and it's not this: else if (instance != this) { //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager. Destroy(gameObject); } levelManager = GameObject.Find("LevelManager").GetComponent <LevelManager>(); InitializePickups(); }
void Start() { if (SceneManager.GetActiveScene().name == "Demo") { instance = this; IsDemo = true; GameMenuManager = Instantiate(GameMenuManager, instance.transform); GameMenuManager.transform.parent = this.transform; BuildingManager = Instantiate(BuildingManager, instance.transform); BuildingManager.transform.parent = this.transform; PlayerCamera = Instantiate(PlayerCamera, instance.transform); PlayerCamera.transform.parent = this.transform; CollectableManager = Instantiate(CollectableManager, instance.transform); CollectableManager.transform.parent = this.transform; EnemyManager = Instantiate(EnemyManager, instance.transform); EnemyManager.transform.parent = this.transform; Player = Instantiate(Player, instance.transform); Player.transform.parent = this.transform; TileManager = Instantiate(TileManager, instance.transform); TileManager.transform.parent = this.transform; MissionManager = Instantiate(MissionManager, instance.transform); MissionManager.transform.parent = this.transform; } else { instance = this; MenuManager = Instantiate(MenuManager, instance.transform); MenuManager.transform.parent = this.transform; BuildingManager = Instantiate(BuildingManager, instance.transform); BuildingManager.transform.parent = this.transform; PlayerCamera = Instantiate(PlayerCamera, instance.transform); PlayerCamera.transform.parent = this.transform; CollectableManager = Instantiate(CollectableManager, instance.transform); CollectableManager.transform.parent = this.transform; EnemyManager = Instantiate(EnemyManager, instance.transform); EnemyManager.transform.parent = this.transform; Player = Instantiate(Player, instance.transform); Player.transform.parent = this.transform; TileManager = Instantiate(TileManager, instance.transform); TileManager.transform.parent = this.transform; } }
public void StartTrackManager() { if (checkpoints.Count == 0) { return; } Object[] allRacerArray = FindObjectsOfType <Object> ().Where(x => x is IRacer).ToArray(); for (int i = 0; i < allRacerArray.Length; i++) { IRacer racer = allRacerArray[i] as IRacer; m_RacerNextCheckpoints.Add(racer, checkpoints[0]); racer.DisableControl(); } if (collectableManager == null) { collectableManager = GameObject.Find("CollectableManager").GetComponent <CollectableManager>(); } }
void Awake() { // Save the original camera position cameraOriginalPosition = Camera.main.transform.position; // Make a copy of this for internal tracking internalShakeLength = shakeLength; // Find our coin manager coinManager = GameObject.FindWithTag("CoinManager").GetComponent <CoinManager>(); // Find our play field playFieldArea = GameObject.FindWithTag("CoinsPlayField").GetComponent <Transform>(); // Find our coin spawner coinSpawner = GameObject.FindWithTag("CoinSpawnerArea").GetComponent <CoinSpawner>(); // Find the collectableManager collectableManager = GameObject.FindWithTag("CollectableManager").GetComponent <CollectableManager>(); // Find the pusher pushBar = GameObject.FindWithTag("PushBar").GetComponent <Pusher>(); }
void Start() { m_Manager = GameObject.FindGameObjectWithTag(Constants.COLLECTABLE_MANAGER).GetComponent <CollectableManager>(); }
void Start() { m_Manager = GameObject.FindGameObjectWithTag(Constants.COLLECTABLE_MANAGER).GetComponent<CollectableManager>(); }
void Start() { _audioSource = GetComponent <AudioSource>(); collectableManager = FindObjectOfType <CollectableManager>(); }
void Start() { collectableManager = GameObject.Find("CollectableManager").GetComponent <CollectableManager>(); }
// Use this for initialization void Start() { rb = GetComponent <Rigidbody>(); _collectableManager = collectableManagerObj.GetComponent <CollectableManager>(); }
void OnApplicationQuit() { s_Instance = null; }
public void Execute(CollectableManager collectableManager) { Debug.Log(collectable.name + " removed from scene"); collectableManager.RemoveCollectable(collectable); }
public bool CanExecute(CollectableManager collectableManager) { return(true); }
// Use this for initialization void Start() { thisAreaTrigger = GetComponent <AreaTrigger>(); collectableManager = GameObject.FindGameObjectWithTag("Player").GetComponent <CollectableManager>(); }