コード例 #1
0
    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>();
    }
コード例 #2
0
ファイル: Timer.cs プロジェクト: gqbeerman/pixel_crush
    void Start()
    {
        LevelGoalTimed goal = GameManager.Instance.GetComponent <LevelGoalTimed>();

        if (goal != null && goal.timer == null)
        {
            goal.timer = this;
            InitTimer(goal.timeLeft);
        }
    }
コード例 #3
0
    public override void Awake()
    {
        base.Awake();

        // fill in LevelGoal and LevelGoalTimed components
        m_levelGoal      = GetComponent <LevelGoal>();
        m_levelGoalTimed = GetComponent <LevelGoalTimed>();

        // cache a reference to the Board
        m_board = GameObject.FindObjectOfType <Board>().GetComponent <Board>();
    }
コード例 #4
0
    IEnumerator WaitForBoardRoutine(float delay = 0f)
    {
        if (m_levelGoal is LevelGoalTimed)
        {
            LevelGoalTimed levelGoalTimer = (LevelGoalTimed)m_levelGoal;
            if (levelGoalTimer.timer != null)
            {
                levelGoalTimer.timer.FadeOff();
                levelGoalTimer.timer.paused = true;
            }
        }

        if (m_board != null)
        {
            //wait for board class swap time
            yield return(new WaitForSeconds(m_board.swapTime));

            while (m_board.isRefilling)
            {
                yield return(null);
            }
        }
        yield return(new WaitForSeconds(delay));
    }