Esempio n. 1
0
            public override void Func(string[] _params)
            {
                bool stopOrStart = false; // false == stop, true == start

                if (_params[0].Equals("start"))
                {
                    stopOrStart = true;
                }
                else if (_params[0].Equals("stop"))
                {
                    stopOrStart = false;
                }
                else
                {
                    Debug.LogError("Invalid parameter on SnowEffect function!");
                    ScriptMaster.NextLine();
                    return;
                }

                // starting
                if (stopOrStart == true)
                {
                    SakuraEffectInstance = GameObject.Instantiate <GameObject>(SakuraEffectPrefab, ScriptMaster.GetCanvas(M22.ScriptMaster.CANVAS_TYPES.POSTCHARACTER).transform);
                    SakuraEffectScript   = SakuraEffectInstance.GetComponent <SakuraEffectObjectScript>();
                }
                else // stopping
                {
                    if (SakuraEffectInstance == null || SakuraEffectScript == null)
                    {
                        Debug.LogError("Trying to stop SnowEffect when there isn't one!");
                        ScriptMaster.NextLine();
                        return;
                    }
                    SakuraEffectScript.Stop();
                }

                ScriptMaster.NextLine();
            }
Esempio n. 2
0
 void HandleChoice(string _choice)
 {
     Destroy(this.gameObject);
     int stringIndex = choiceStrings.FindIndex(a => a == _choice);
     if (scriptMastRef.SCRIPT_FLAGS.Contains(choiceFlags[stringIndex]))
     {
         // flag exists? shouldn't happen
         Debug.LogError("MakeDecision error; setting flag that already exists! Use unique identifiers in your decisions!");
     }
     else
     {
         scriptMastRef.SCRIPT_FLAGS.Add(choiceFlags[stringIndex]);
     }
     scriptMastRef.NextLine();
 }