// Start is called before the first frame update void Start() { CollectionGoalPanel[] children = GetComponentsInChildren <CollectionGoalPanel>(true); int i; for (i = 0; i < children.Length; i++) // clean up any extras { DestroyImmediate(children[i].gameObject); } LevelGoalCollected goal = GameManager.Instance.LevelGoal as LevelGoalCollected; if (goal != null) { children = new CollectionGoalPanel[goal.collectionGoals.Length]; for (i = 0; i < goal.collectionGoals.Length; i++) { if (children[i] == null) { children[i] = Instantiate <CollectionGoalPanel>(prefab, transform); } children[i].collectionGoal = goal.collectionGoals[i]; } goal.uiPanels = children; } }
public override void Awake() { base.Awake(); m_levelGoal = GetComponent <LevelGoal>(); m_levelGoalCollected = GetComponent <LevelGoalCollected>(); m_board = GameObject.FindObjectOfType <Board>().GetComponent <Board>(); }
public override void Awake() { base.Awake(); DontDestroyOnLoad(this.gameObject); board = FindObjectOfType <Board>().GetComponent <Board>(); levelGoal = GetComponent <LevelGoal>(); levelGoalCollected = GetComponent <LevelGoalCollected>(); }
public override void Awake() { base.Awake(); m_levelGoal = GetComponent <LevelGoal>(); m_levelGoalTimed = GetComponent <LevelGoalTimed>(); m_levelGoalCollected = GetComponent <LevelGoalCollected>(); //cache reference to goal m_board = FindObjectOfType <Board>().GetComponent <Board>(); }
public override void Awake() { base.Awake(); // fill in LevelGoal and LevelGoalTimed components m_levelGoal = GetComponent <LevelGoal>(); // m_levelGoalTimed = GetComponent<LevelGoalTimed>(); m_levelGoalCollected = GetComponent <LevelGoalCollected>(); // cache a reference to the Board m_board = GameObject.FindObjectOfType <Board>().GetComponent <Board>(); }
} // other classes access Levelgoal through gamemanager. public override void Awake() //already defined awake in levelgoal singleton, we have to override it. tile.cs and rectxformmover. { base.Awake(); //get all the logic from singleton base class. awake is earlier than stat. m_dataManager = Object.FindObjectOfType <DataManager>(); m_soundManager = Object.FindObjectOfType <SoundManager>(); if (SceneManager.GetActiveScene().buildIndex > 1) { m_levelGoal = GetComponent <LevelGoal>(); // m_levelGoalTimed = GetComponent<LevelGoalTimed>(); // omitted because levelgoal class now has time related components. m_levelGoalCollected = GetComponent <LevelGoalCollected>(); m_board = GameObject.FindObjectOfType <Board>().GetComponent <Board>(); } }
public override void Awake() { base.Awake(); // fill in LevelGoal and LevelGoalTimed components m_levelGoal = GetComponent <LevelGoal>(); // m_levelGoalTimed = GetComponent<LevelGoalTimed>(); m_levelGoalCollected = GetComponent <LevelGoalCollected>(); // cache a reference to the Board m_board = GameObject.FindObjectOfType <Board>().GetComponent <Board>(); Chartboost.cacheInterstitial(CBLocation.Default); }
public override void Awake() { base.Awake(); LoadInfo.LoadData(); // fill in LevelGoal and LevelGoalTimed components m_levelGoal = GetComponent <LevelGoal>(); // m_levelGoalTimed = GetComponent<LevelGoalTimed>(); m_levelGoalCollected = GetComponent <LevelGoalCollected>(); // cache a reference to the Board m_board = GameObject.FindObjectOfType <Board>().GetComponent <Board>(); boosterTile = GetComponent <Tile>(); IsGameOver = false; m_isWinner = false; }