Exemple #1
0
 // Token: 0x060021BB RID: 8635 RVA: 0x001901B4 File Offset: 0x0018E3B4
 public void RunModifiers(Seeker.ModifierPass pass, Path path)
 {
     if (pass == Seeker.ModifierPass.PreProcess)
     {
         if (this.preProcessPath != null)
         {
             this.preProcessPath(path);
         }
         for (int i = 0; i < this.modifiers.Count; i++)
         {
             this.modifiers[i].PreProcess(path);
         }
         return;
     }
     if (pass == Seeker.ModifierPass.PostProcess)
     {
         if (this.postProcessPath != null)
         {
             this.postProcessPath(path);
         }
         for (int j = 0; j < this.modifiers.Count; j++)
         {
             this.modifiers[j].Apply(path);
         }
     }
 }
Exemple #2
0
	public void RunModifiers(Seeker.ModifierPass pass, Path p)
	{
		if (pass == Seeker.ModifierPass.PreProcess && this.preProcessPath != null)
		{
			this.preProcessPath(p);
		}
		else if (pass == Seeker.ModifierPass.PostProcess && this.postProcessPath != null)
		{
			this.postProcessPath(p);
		}
		for (int i = 0; i < this.modifiers.Count; i++)
		{
			MonoModifier monoModifier = this.modifiers[i] as MonoModifier;
			if (!(monoModifier != null) || monoModifier.enabled)
			{
				if (pass == Seeker.ModifierPass.PreProcess)
				{
					this.modifiers[i].PreProcess(p);
				}
				else if (pass == Seeker.ModifierPass.PostProcess)
				{
					this.modifiers[i].Apply(p);
				}
			}
		}
	}
Exemple #3
0
 static int RunModifiers(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         Seeker obj = (Seeker)ToLua.CheckObject <Seeker>(L, 1);
         Seeker.ModifierPass arg0 = (Seeker.ModifierPass)ToLua.CheckObject(L, 2, typeof(Seeker.ModifierPass));
         Pathfinding.Path    arg1 = (Pathfinding.Path)ToLua.CheckObject <Pathfinding.Path>(L, 3);
         obj.RunModifiers(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #4
0
    public void RunModifiers(Seeker.ModifierPass pass, Path p)
    {
        bool flag = true;

        while (flag)
        {
            flag = false;
            for (int i = 0; i < this.modifiers.Count - 1; i++)
            {
                if (this.modifiers[i].Priority < this.modifiers[i + 1].Priority)
                {
                    IPathModifier value = this.modifiers[i];
                    this.modifiers[i]     = this.modifiers[i + 1];
                    this.modifiers[i + 1] = value;
                    flag = true;
                }
            }
        }
        switch (pass)
        {
        case Seeker.ModifierPass.PreProcess:
            if (this.preProcessPath != null)
            {
                this.preProcessPath(p);
            }
            break;

        case Seeker.ModifierPass.PostProcessOriginal:
            if (this.postProcessOriginalPath != null)
            {
                this.postProcessOriginalPath(p);
            }
            break;

        case Seeker.ModifierPass.PostProcess:
            if (this.postProcessPath != null)
            {
                this.postProcessPath(p);
            }
            break;
        }
        if (this.modifiers.Count == 0)
        {
            return;
        }
        ModifierData  modifierData = ModifierData.All;
        IPathModifier pathModifier = this.modifiers[0];

        for (int j = 0; j < this.modifiers.Count; j++)
        {
            MonoModifier monoModifier = this.modifiers[j] as MonoModifier;
            if (!(monoModifier != null) || monoModifier.enabled)
            {
                switch (pass)
                {
                case Seeker.ModifierPass.PreProcess:
                    this.modifiers[j].PreProcess(p);
                    break;

                case Seeker.ModifierPass.PostProcessOriginal:
                    this.modifiers[j].ApplyOriginal(p);
                    break;

                case Seeker.ModifierPass.PostProcess:
                {
                    ModifierData modifierData2 = ModifierConverter.Convert(p, modifierData, this.modifiers[j].input);
                    if (modifierData2 != ModifierData.None)
                    {
                        this.modifiers[j].Apply(p, modifierData2);
                        modifierData = this.modifiers[j].output;
                    }
                    else
                    {
                        UnityEngine.Debug.Log(string.Concat(new string[]
                            {
                                "Error converting ",
                                (j <= 0) ? "original" : pathModifier.GetType().Name,
                                "'s output to ",
                                this.modifiers[j].GetType().Name,
                                "'s input.\nTry rearranging the modifier priorities on the Seeker."
                            }));
                        modifierData = ModifierData.None;
                    }
                    pathModifier = this.modifiers[j];
                    break;
                }
                }
                if (modifierData == ModifierData.None)
                {
                    break;
                }
            }
        }
    }