Esempio n. 1
0
    public void Flex_ActionStart(string name, FlexActionableComponent sender, GameObject collider)
    {
        bool option;

        //SettingsInput.print("button pressed");
        switch (sender.name)
        {
        case "SoundFX":
            option = !GameOptions.instance.options[(int)GameOptions.OPTIONS.SoundFX];
            GameOptions.instance.options[(int)GameOptions.OPTIONS.SoundFX] = !option;
            break;

        case "TextDescriptions":
            option = !GameOptions.instance.options[(int)GameOptions.OPTIONS.TextDescriptions];
            GameOptions.instance.options[(int)GameOptions.OPTIONS.TextDescriptions] = !option;
            break;

        case "VoiceTutorial":
            option = !GameOptions.instance.options[(int)GameOptions.OPTIONS.VoiceOver];
            GameOptions.instance.options[(int)GameOptions.OPTIONS.VoiceOver] = !option;
            break;

        default:
            return;
        }
        if (option)
        {
            sender.SetState(1);
        }
        else
        {
            sender.SetState(0);
        }
    }
 public void Flex_ActionEnd(string name, FlexActionableComponent sender, GameObject collider)
 {
     if (sender.State != 2)
     {
         sender.SetState(0);
     }
 }
Esempio n. 3
0
 protected override void OnActionStart(FlexActionableComponent sender, GameObject collider)
 {
     ClearSelection();
     if (sender.State != -1)
     {
         sender.SetState(1);
     }
 }
 private void Update()
 {
     if (numhitters > 0)
     {
         if (flexActionableComponent.State == 0)
         {
             flexActionableComponent.SetState(1);
         }
     }
     else
     {
         if (flexActionableComponent.State == 1)
         {
             flexActionableComponent.SetState(0);
         }
     }
 }
Esempio n. 5
0
 protected override void OnActionStart(FlexActionableComponent sender, GameObject collider)
 {
     if (MultiSelect)
     {
         if (sender.State == 2)
         {
             sender.SetState(1);
         }
         else
         {
             sender.SetState(2);
         }
     }
     else
     {
         sender.SetState(2);
     }
 }
Esempio n. 6
0
 // Use this for initialization
 void Start()
 {
     if (defaultSetting != null)
     {
         defaultSetting.SetState(2);
     }
     //Actions.Clear();
     AddAllChildActions();
 }
Esempio n. 7
0
 protected override void OnActionEnd(FlexActionableComponent sender, GameObject collider)
 {
     if (MultiSelect)
     {
     }
     else
     {
         sender.SetState(0);
     }
 }
    public void Flex_ActionStart(string name, FlexActionableComponent sender, GameObject collider)
    {
        switch (sender.name)
        {
        case "Button_del":
            if (index > 0)
            {
                currExpression.RemoveAt(index - 1);
                isReady = true;
                index--;
            }
            break;

        case "Button_Clear":
            index = 0;
            currExpression.Clear();
            break;

        case "Button_Enter":
            isReady = true;
            break;

        default:
            currExpression.Insert(index, sender.name);
            isReady = true;
            index++;
            break;

        case "Button_left":
            index--;
            if (index < 0)
            {
                index = 0;
            }
            break;

        case "Button_right":
            index++;
            if (index > currExpression.Count)
            {
                index = currExpression.Count;
            }
            break;

        case "Button_start":
            index = 0;
            break;

        case "Button_end":
            index = currExpression.Count;
            break;

        //case "Button_Xinput":
        //    currExpression = xExpression;
        //    currText = xText;
        //    index = xExpression.Count;
        //    break;
        //case "Button_Yinput":
        //    currExpression = yExpression;
        //    currText = yText;
        //    index = yExpression.Count;
        //    break;
        case "Button_Zinput":
            currExpression = zExpression;
            currText       = zText;
            index          = zExpression.Count;
            break;

        case "umin":
            currExpression = uMinExp;
            currText       = uMinText;
            index          = uMinExp.Count;
            break;

        case "umax":
            currExpression = uMaxExp;
            currText       = uMaxText;
            index          = uMaxExp.Count;
            break;

        case "vmin":
            currExpression = vMinExp;
            currText       = vMinText;
            index          = vMinExp.Count;
            break;

        case "vmax":
            currExpression = vMaxExp;
            currText       = vMaxText;
            index          = vMaxExp.Count;
            break;
        }
        //index++;
        //xText.text = displayText(xExpression, xExpression.Count, false);
        //yText.text = displayText(yExpression, yExpression.Count, false);
        zText.text    = displayText(zExpression, zExpression.Count, false);
        uMinText.text = displayText(uMinExp, uMinExp.Count, false);
        uMaxText.text = displayText(uMaxExp, uMaxExp.Count, false);
        vMinText.text = displayText(vMinExp, vMinExp.Count, false);
        vMaxText.text = displayText(vMaxExp, vMaxExp.Count, false);
        currText.text = displayText(currExpression, index, true);

        sender.SetState(1);
    }
Esempio n. 9
0
    public void Flex_ActionStart(string name, FlexActionableComponent sender, GameObject collider)
    {
        switch (sender.name)
        {
        case "Button_del":
            if (index > 0)
            {
                currExpression.tokens.RemoveAt(index - 1);
                index--;
            }
            break;

        case "Button_Clear":
            index = 0;
            currExpression.tokens.Clear();
            break;

        case "Button_Enter":
            isReady = true;
            break;

        default:
            currExpression.tokens.Insert(index, sender.name);
            isReady = true;
            index++;
            break;

        case "Button_left":
            index--;
            if (index < 0)
            {
                index = 0;
            }
            break;

        case "Button_right":
            index++;
            if (index > currExpression.tokens.Count)
            {
                index = currExpression.tokens.Count;
            }
            break;

        case "Button_start":
            index = 0;
            break;

        case "Button_end":
            index = currExpression.tokens.Count;
            break;

        case "Button_Xinput":
            currExpression = es.expressions["X"];
            currText       = xText;
            index          = currExpression.tokens.Count;
            break;

        case "Button_Yinput":
            currExpression = es.expressions["Y"];
            currText       = yText;
            index          = currExpression.tokens.Count;
            break;

        case "Button_Zinput":
            currExpression = es.expressions["Z"];
            currText       = zText;
            index          = currExpression.tokens.Count;
            break;

        case "tmin":
            currExpression = es.ranges["t"].Min;
            currText       = tminText;
            index          = currExpression.tokens.Count;
            break;

        case "tmax":
            currExpression = es.ranges["t"].Max;
            currText       = tmaxText;
            index          = currExpression.tokens.Count;
            break;

        case "high":
            dens    = CustomVectorField.SampleDensity.HIGH;
            isReady = true;
            break;

        case "medium":
            dens    = CustomVectorField.SampleDensity.MEDIUM;
            isReady = true;
            break;

        case "low":
            dens    = CustomVectorField.SampleDensity.LOW;
            isReady = true;
            break;
        }
        //index++;
        xText.text    = displayText(es.expressions["X"].tokens, es.expressions["X"].tokens.Count, false);
        yText.text    = displayText(es.expressions["Y"].tokens, es.expressions["Y"].tokens.Count, false);
        zText.text    = displayText(es.expressions["Z"].tokens, es.expressions["Z"].tokens.Count, false);
        tminText.text = displayText(es.ranges["t"].Min.tokens, es.ranges["t"].Min.tokens.Count, false);
        tmaxText.text = displayText(es.ranges["t"].Max.tokens, es.ranges["t"].Max.tokens.Count, false);
        currText.text = displayText(currExpression.tokens, index, true);

        sender.SetState(1);
    }
Esempio n. 10
0
    public void Flex_ActionStart(string name, FlexActionableComponent sender, GameObject collider)
    {
        switch (sender.name)
        {
        case "None":
            paramSurface.particleEffect = CustomParametrizedSurface.ParticleEffectList.None;
            if (effect != null)
            {
                effect.SetState(0);
            }
            effect = sender;
            break;

        case "Gravity":
            paramSurface.particleEffect = CustomParametrizedSurface.ParticleEffectList.Gravity;
            if (effect != null)
            {
                effect.SetState(0);
            }
            effect = sender;
            break;

        case "Lerp":
            paramSurface.particleEffect = CustomParametrizedSurface.ParticleEffectList.Lerp;
            if (effect != null)
            {
                effect.SetState(0);
            }
            effect = sender;
            break;

        case "SmoothLerp":
            paramSurface.particleEffect = CustomParametrizedSurface.ParticleEffectList.SmoothLerp;
            if (effect != null)
            {
                effect.SetState(0);
            }
            effect = sender;
            break;

        case "Explode":
            paramSurface.particleEffect = CustomParametrizedSurface.ParticleEffectList.Explode;
            if (effect != null)
            {
                effect.SetState(0);
            }
            effect = sender;
            break;

        case "Swirl":
            paramSurface.particleEffect = CustomParametrizedSurface.ParticleEffectList.Swirl;
            if (effect != null)
            {
                effect.SetState(0);
            }
            effect = sender;
            break;

        case "SpeedFast":
            paramSurface.effectStrength = 2f;
            if (speed != null)
            {
                speed.SetState(0);
            }
            speed = sender;
            break;

        case "SpeedMed":
            paramSurface.effectStrength = 1f;
            if (speed != null)
            {
                speed.SetState(0);
            }
            speed = sender;
            break;

        case "SpeedSlow":
            paramSurface.effectStrength = 0.5f;
            if (speed != null)
            {
                speed.SetState(0);
            }
            speed = sender;
            break;
        }
        isReady = true;
        if (effect != null)
        {
            effect.SetState(2);
        }
        if (speed != null)
        {
            speed.SetState(2);
        }
    }
Esempio n. 11
0
 protected override void OnActionStart(FlexActionableComponent sender, GameObject collider)
 {
     sender.SetState(2);
 }