Ejemplo n.º 1
0
    //************************************************
    // fsmMENU
    //------------------------------------------------
    //************************************************
    IEnumerator fsmConstruct(eSTATE state)
    {
        m_WaveDone = 0;



        yield return(waitMessage("You have \n\n" + m_GameConfig.m_ConstructDuration + " seconds\n\n to prepare the room"));

        m_BGMFightDestVol   = 0f;
        m_BGMAmbientDestVol = 1.0f;

        m_Timer.SetTimer(m_GameConfig.m_ConstructDuration);

        yield return(new WaitForSeconds(m_GameConfig.m_ConstructDuration));


        m_State = eSTATE.fsmWaveReady;
    }
Ejemplo n.º 2
0
    public void AddTimer(string timerID, Transform objectToFollow, Vector3?offset = null)
    {
        UITimer timer = null;

        if (!_timersDict.ContainsKey(timerID))
        {
            timer = Instantiate(_timerPrefab).GetComponent <UITimer>();
            timer.transform.SetParent(transform, true);
            timer.transform.localScale    = Vector3.one;
            timer.transform.localRotation = Quaternion.identity;
            _timersDict.Add(timerID, timer);
        }
        else
        {
            timer = _timersDict[timerID];
        }

        if (timer != null)
        {
            if (offset.HasValue)
            {
                timer.transform.localPosition = offset.Value;
            }

            timer.SetTimer(timerID);
            UIWorldPositioner worldPos = timer.GetComponent <UIWorldPositioner>();
            if (worldPos != null)
            {
                worldPos.ObjectToFollow = objectToFollow;

                if (offset.HasValue)
                {
                    worldPos.Offset = offset.Value;
                }
            }
        }
    }