Beispiel #1
0
        void SendEvents(SliderUiEventStateAnimatorParameterSetterData uiEvent)
        {
            switch (uiEvent.Type)
            {
            case AnimatorControllerParameterType.Bool:
                var boolValue = _setter.GetBool(uiEvent.Name);
                _setter.SetBool(uiEvent.Name, !boolValue);
                break;

            case AnimatorControllerParameterType.Float:
                _setter.SetFloat(uiEvent.Name, uiEvent.FloatVlaue);
                break;

            case AnimatorControllerParameterType.Int:
                _setter.SetInt(uiEvent.Name, uiEvent.IntVlaue);
                break;

            case AnimatorControllerParameterType.Trigger:
                _setter.SetTrigger(uiEvent.Name);
                break;

            default:
                break;
            }
        }
Beispiel #2
0
        void CheckRelationalOperator(float newValue, SliderUiEventStateAnimatorParameterSetterData uiEvent)
        {
            switch (uiEvent.RelationalOperator)
            {
            case RelationalOperatorsEnum.EqualTo:
                if (newValue == uiEvent.CompairsonValue)
                {
                    SendEvents(uiEvent);
                }
                break;

            case RelationalOperatorsEnum.GreaterThan:
                if (newValue > uiEvent.CompairsonValue)
                {
                    SendEvents(uiEvent);
                }
                break;

            case RelationalOperatorsEnum.GreaterThanOrEqualTo:
                if (newValue >= uiEvent.CompairsonValue)
                {
                    SendEvents(uiEvent);
                }
                break;

            case RelationalOperatorsEnum.LessThan:
                if (newValue < uiEvent.CompairsonValue)
                {
                    SendEvents(uiEvent);
                }
                break;

            case RelationalOperatorsEnum.LessThanOrEqualTo:
                if (newValue <= uiEvent.CompairsonValue)
                {
                    SendEvents(uiEvent);
                }
                break;

            case RelationalOperatorsEnum.NotEqualTo:
                if (newValue != uiEvent.CompairsonValue)
                {
                    SendEvents(uiEvent);
                }
                break;

            default:
                break;
            }
        }