예제 #1
0
 //------------------------------------------------------------------------------------------------------------
 public void Sing()
 {
     Debug.Log("I sing now!!!");
     Blobstate = BLOBSTATES.SING;
     SendMessageUpwards("ValidateStep", BlobID);
     m_gvrAudioSource.Play();
 }
예제 #2
0
        //------------------------------------------------------------------------------------------------------------
        private void TriggerAnimation(BLOBSTATES _state)
        {
            string[] _triggers = m_blobAnimationTriggers[_state];
            string   _trigger  = (_triggers.Length > 0) ? _triggers[UnityEngine.Random.Range(0, _triggers.Length - 1)] : _triggers[0];

            Debug.LogFormat("Trigger {0} on {1}, choosen from {2} triggers", _state, gameObject.name, _triggers.Length);

            Animator.SetTrigger(_trigger);

            //  Debug.Break();
        }
예제 #3
0
 //------------------------------------------------------------------------------------------------------------
 private void OnSingComplete(string _stateAsString)
 {
     Debug.Log(_stateAsString + " is complete for" + gameObject.name + "in state " + Blobstate);
     if (_stateAsString == BLOBSTATES.SING.ToString())
     {
         Debug.Log("Sing completed");
         SendMessageUpwards("SequenceStepCompleted", BlobID);
         Blobstate = BLOBSTATES.IDLE;
         return;
     }
 }
예제 #4
0
        //------------------------------------------------------------------------------------------------------------
        private void changeState(BLOBSTATES _state)
        {
            Debug.Log("changing animation state to" + _state);
            m_blobState = _state;
            TriggerAnimation(m_blobState);
            switch (m_blobState)
            {
            case (BLOBSTATES.IDLE):
                break;

            case (BLOBSTATES.SING):
                break;
            }
        }
예제 #5
0
 public void AnimationComplete(string _finishedAnimation)
 {
     //Debug.Break();
     Debug.Log(_finishedAnimation + " is complete for" + gameObject.name + "in state " + Blobstate);
     if (_finishedAnimation == BLOBSTATES.SING.ToString())
     {
         Debug.Log("Sing completed");
         SendMessageUpwards("SequenceStepCompleted", BlobID);
         Blobstate = BLOBSTATES.IDLE;
         return;
     }
     if (Blobstate == BLOBSTATES.SING)
     {
         return;                                           // we're entering from another animation state here, which could interrupt the singing
     }
     if (_finishedAnimation != BLOBSTATES.IDLE.ToString()) // we do not want to be idling like crazy, don't we?
     {
         Debug.Log("I am not blobstate sing? I'm " + Blobstate);
         Blobstate = BLOBSTATES.IDLE;
     }
 }