Пример #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();
            }
Пример #2
0
 public override void Func(string[] _params)
 {
     if (_params[0].Equals("show"))
     {
         HospitalMaskInstance = GameObject.Instantiate <GameObject>(HospitalMaskPrefab, ScriptMaster.GetCanvas(M22.ScriptMaster.CANVAS_TYPES.POSTCHARACTER).GetComponent <RectTransform>().transform) as GameObject;
     }
     else
     {
         if (HospitalMaskInstance == null)
         {
             Debug.Log("Can't delete mask, there is no mask!");
         }
         else
         {
             GameObject.Destroy(HospitalMaskInstance);
         }
     }
     Camera.main.GetComponent <M22.ScriptMaster>().NextLine();
 }