예제 #1
0
    public static Vector3 GetVector3(this AIRuntimeController controller, string name)
    {
        NamedParameter param = controller.GetParameter(name);

        if (param is GameObjectParameter)
        {
            return(((GameObjectParameter)param).Value.transform.position);
        }
        Vector3Parameter v = (Vector3Parameter)controller.GetParameter(name);

        return(v != null ? v.Value : Vector3.zero);
    }
예제 #2
0
    public static float GetFloatOrInt(this AIRuntimeController controller, string name)
    {
        NamedParameter param = controller.GetParameter(name);

        if (param != null)
        {
            if (param is FloatParameter)
            {
                return(controller.GetFloat(name));
            }
            else
            {
                return(controller.GetInt(name));
            }
        }
        Debug.Log("null");
        return(0);
    }
예제 #3
0
    public static void SetBool(this AIRuntimeController controller, string name, bool value)
    {
        BoolParameter param = (BoolParameter)controller.GetParameter(name);

        param.Value = value;
    }
예제 #4
0
    public static bool GetBool(this AIRuntimeController controller, string name)
    {
        BoolParameter param = (BoolParameter)controller.GetParameter(name);

        return(param != null ? param.Value : false);
    }
예제 #5
0
    public static GameObject GetGameObject(this AIRuntimeController controller, string name)
    {
        GameObjectParameter param = (GameObjectParameter)controller.GetParameter(name);

        return(param != null ? param.Value : null);
    }
예제 #6
0
    public static void SetVector3(this AIRuntimeController controller, string name, Vector3 value)
    {
        Vector3Parameter param = (Vector3Parameter)controller.GetParameter(name);

        param.Value = value;
    }
예제 #7
0
    public static void SetString(this AIRuntimeController controller, string name, string value)
    {
        StringParameter param = (StringParameter)controller.GetParameter(name);

        param.Value = value;
    }
예제 #8
0
    public static string GetString(this AIRuntimeController controller, string name)
    {
        StringParameter param = (StringParameter)controller.GetParameter(name);

        return(param != null ? param.Value : string.Empty);
    }
예제 #9
0
    public static void SetFloat(this AIRuntimeController controller, string name, float value)
    {
        FloatParameter param = (FloatParameter)controller.GetParameter(name);

        param.Value = value;
    }
예제 #10
0
    public static float GetFloat(this AIRuntimeController controller, string name)
    {
        FloatParameter param = (FloatParameter)controller.GetParameter(name);

        return(param != null ? param.Value : 0);
    }
예제 #11
0
    public static void SetGameObject(this AIRuntimeController controller, string name, GameObject go)
    {
        GameObjectParameter param = (GameObjectParameter)controller.GetParameter(name);

        param.Value = go;
    }
예제 #12
0
    public static void SetInt(this AIRuntimeController controller, string name, int value)
    {
        IntParameter param = (IntParameter)controller.GetParameter(name);

        param.Value = value;
    }
예제 #13
0
    public static int GetInt(this AIRuntimeController controller, string name)
    {
        IntParameter param = (IntParameter)controller.GetParameter(name);

        return(param != null ? param.Value : 0);
    }