예제 #1
0
    private void ParseGameEffect_SpawnMinionThrow(TextFieldParser parser, EffectDef def)
    {
        Debug.Log("Hey are you parsing SpawnMinonThrow?");
        TagWeights tagWeights = Utils.ParseTagWeights(parser, "Params", true);

        if (tagWeights == null)
        {
            def.worldMethod = GameEffectManager.CreateMethod_LogMessage(LogLevel.Error, "Broken SpawnMinionThrow GameEffect for: " + def.id);
        }
        else
        {
            int    level;
            string tagAndWeight = tagWeights.GetTagAndWeight(0, out level);
            def.worldMethod = CreateMethod_SpawnMinionThrow(tagAndWeight, level, Utils.TryParseFloat(parser, "Radius", null), Utils.TryParseFloat(parser, "Duration", null));
        }
    }
예제 #2
0
 private void ParseGameEffect_MaybeSpawnMinions(TextFieldParser parser, EffectDef def)
 {
     // 20% chance to spawn minions?
     if (UnityEngine.Random.Range(0, 100) < 5)
     {
         TagWeights tagWeights = Utils.ParseTagWeights(parser, "Params", true);
         if (tagWeights == null)
         {
             def.worldMethod = GameEffectManager.CreateMethod_LogMessage(LogLevel.Error, "Broken SpawnMinions GameEffect for: " + def.id);
         }
         else
         {
             string tagAndWeight = tagWeights.GetTagAndWeight(0, out int level);
             def.worldMethod = GameEffectManager.CreateMethod_SpawnMinions(tagAndWeight, level, Utils.TryParseFloat(parser, "Radius", null), Utils.TryParseFloat(parser, "Duration", null));
         }
     }
 }