예제 #1
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        effectsManager my_script = (effectsManager)target;

        if (GUILayout.Button("Clear effects (test)"))
        {
            my_script.runClearTest();
        }


        if (GUILayout.Button("Run effect (test)"))
        {
            my_script.runTest();
        }
    }
 public void setManager(effectsManager _manager)
 {
     m_effects_manager = _manager;
 }
        public static cRunEffect create(effectConfig _config, effectsManager _manager)
        {
            cRunEffect effect = null;

            effect = new cRunEffect(_config);
            effect.setManager(_manager);

            if (_config.m_type == eEffectType.COMPOUND_TYPE)
            {
            }
            else if (_config.m_type == eEffectType.TERMINAL_ROTATE)
            {
                effect.m_config.m_mode = eEffectMode.TERMINAL_MODE;
                effect.m_behaviour     = effect.behaviour_type_rotate;
            }
            else if (_config.m_type == eEffectType.TERMINAL_MOVE_LINE_GLOBAL_POS ||
                     _config.m_type == eEffectType.TERMINAL_MOVE_LINE_LOCAL_POS)
            {
                effect.m_config.m_mode = eEffectMode.TERMINAL_MODE;
                effect.m_behaviour     = effect.behaviour_move_along_line;
                effect.m_trail_system  = Utilities.getTrailSystem();
                effect.m_trail_id      = effect.m_trail_system.addTrail();
            }
            else if (_config.m_type == eEffectType.TERMINAL_MOVE_ARC_GLOBAL_POS ||
                     _config.m_type == eEffectType.TERMINAL_MOVE_ARC_LOCAL_POS)
            {
                effect.m_config.m_mode = eEffectMode.TERMINAL_MODE;
                effect.m_behaviour     = effect.behaviour_move_along_arc;
                effect.m_trail_system  = Utilities.getTrailSystem();
                effect.m_trail_id      = effect.m_trail_system.addTrail();
            }
            else if (_config.m_type == eEffectType.TERMINAL_SCALE)
            {
                effect.m_config.m_mode = eEffectMode.TERMINAL_MODE;
                effect.m_behaviour     = effect.behaviour_type_scale;
            }
            else if (_config.m_type == eEffectType.TERMINAL_ARRIVE)
            {
                effect.m_config.m_mode = eEffectMode.TERMINAL_MODE;
                effect.m_behaviour     = effect.behaviour_type_arrive;
                if (effect.m_config.m_is_state_normalize)
                {
                    effect.m_config.m_control_object.SetActive(false);
                }
            }
            else if (_config.m_type == eEffectType.TERMINAL_HIDE)
            {
                effect.m_config.m_mode = eEffectMode.TERMINAL_MODE;
                effect.m_behaviour     = effect.behaviour_type_hide;
                if (effect.m_config.m_is_state_normalize)
                {
                    effect.m_config.m_control_object.SetActive(true);
                }
            }
            else if (_config.m_type == eEffectType.TERMINAL_CHANGE_SPRITE)
            {
                effect.m_config.m_mode = eEffectMode.TERMINAL_MODE;
                effect.m_behaviour     = effect.behaviour_type_change_sprite;
            }
            else if (_config.m_type == eEffectType.TERMINAL_FILL_RECT)
            {
                effect.m_config.m_mode = eEffectMode.TERMINAL_MODE;
                effect.m_behaviour     = effect.behaviour_type_fill_rect;
                if (effect.m_config.m_is_state_normalize)
                {
                    var img = effect.m_config.m_control_object.GetComponent <Image>();
                    if (img != null)
                    {
                        img.fillAmount = 0;
                    }
                }
            }
            else if (_config.m_type == eEffectType.TERMINAL_ANIMATION)
            {
                effect.m_config.m_mode = eEffectMode.TERMINAL_MODE;
                effect.m_behaviour     = effect.behaviour_type_animation;
                if (effect.m_config.m_is_state_normalize)
                {
                    var img = effect.m_config.m_control_object.GetComponent <Image>();
                    if (img != null)
                    {
                        img.fillAmount = 0;
                    }
                }
            }
            else if (_config.m_type == eEffectType.TERMINAL_CHANGE_COLOR)
            {
                effect.m_config.m_mode = eEffectMode.TERMINAL_MODE;
                effect.m_behaviour     = effect.behaviour_type_change_color;
            }
            else if (_config.m_type == eEffectType.TERMINAL_TEXT_COUNTER)
            {
                effect.m_config.m_mode = eEffectMode.TERMINAL_MODE;
                effect.m_behaviour     = effect.behaviour_type_counter;
            }
            return(effect);
        }