Пример #1
0
    public void RegisterMotion(EMBaseMotion mo)
    {
        if (mo.GetType() == typeof(EMSimpleMotion))
        {
            if (simpleMotions.ContainsKey((mo as EMSimpleMotion).motionName))
            {
                Debug.LogWarning("Motion manager: on " + mo.gameObject.name + " " + (mo as EMSimpleMotion).motionName + "motion name is already exists");
            }
            else
            {
                simpleMotions.Add((mo as EMSimpleMotion).motionName, (mo as EMSimpleMotion));
            }
        }

        if (mo.GetType() == typeof(EMOpenCloseMotion))
        {
            if (openCloseMotions.ContainsKey((mo as EMOpenCloseMotion).motionName))
            {
                Debug.LogWarning("Motion manager: on " + mo.gameObject.name + " " + (mo as EMOpenCloseMotion).motionName + "motion name is already exists");
            }
            else
            {
                openCloseMotions.Add((mo as EMOpenCloseMotion).motionName, (mo as EMOpenCloseMotion));
            }
        }
    }
Пример #2
0
    public void UnRegisterMotion(EMBaseMotion mo)
    {
        if (mo.GetType() == typeof(EMSimpleMotion))
        {
            simpleMotions.Remove((mo as EMSimpleMotion).motionName);
        }

        if (mo.GetType() == typeof(EMOpenCloseMotion))
        {
            openCloseMotions.Remove((mo as EMOpenCloseMotion).motionName);
        }
    }