示例#1
0
 protected override void On_StartMotion(string id)
 {
     if (id == motionId)
     {
         if (currentProp.motionType == EMMotionProperties.MotionType.OneShot)
         {
             if (motionState != MotionState.Opening)
             {
                 motionState = MotionState.Opening;
                 onPlayStart.Invoke(motionName);
                 if (simpleProp.sound != null)
                 {
                     EMMotionManager.PlaySound(simpleProp.sound, simpleProp.volume);
                 }
             }
         }
         else
         {
             if (motionState != MotionState.Closing)
             {
                 motionState = MotionState.Closing;
                 onRewindStart.Invoke(motionName);
                 if (simpleProp.sound != null && playSoundRewind)
                 {
                     EMMotionManager.PlaySound(simpleProp.sound, simpleProp.volume);
                 }
             }
         }
     }
 }
示例#2
0
    protected override void On_StartMotion(string id)
    {
        if (id == motionId)
        {
            if (currentProp.motionType == EMMotionProperties.MotionType.Open)
            {
                if (motionState != MotionState.Opening)
                {
                    motionState = MotionState.Opening;
                    onOpenStart.Invoke(motionName);

                    showUIElement();

                    if (openProp.sound != null)
                    {
                        EMMotionManager.PlaySound(openProp.sound, openProp.volume);
                    }
                }
            }
            else
            {
                if (motionState != MotionState.Closing)
                {
                    motionState = MotionState.Closing;
                    onCloseStart.Invoke(motionName);

                    if (closeProp.sound != null)
                    {
                        EMMotionManager.PlaySound(closeProp.sound, closeProp.volume);
                    }
                }
            }
        }
    }