/// <summary> /// On awake /// </summary> void Awake () { if (_instance == null) { // Set up the singleton instance _instance = this; // Initialize the ActionType Colleciton new ActionTypeCollection (); } // Make sure the verb coin panel is not null // This will not be found outside of the Awake method if the verbcoin panel is disabled // (which it usually is) if (_verbCoinPanel == null) { _verbCoinPanel = GameObject.FindObjectOfType<VerbCoinPanel> (); } // Check to see when a sequence has ended ActionSequence.ActionSequencePlayed += HandleActionSequencePlayed; }
/// <summary> /// Opens the verb coin panel. /// </summary> /// <param name="actionSequences">Action sequences.</param> /// <param name="transform">Transform.</param> public void OpenVerbCoinPanel(IList<VerbActionSequence> actionSequences, Transform transform) { // If the verb coin panel was not explicitly set up // then locate one on the scene and set it if (_verbCoinPanel == null) { Debug.Log ("Verb coin panel is null"); _verbCoinPanel = GameObject.FindObjectOfType<VerbCoinPanel>(); } _verbCoinPanel.OpenPanel (transform, actionSequences); }