Пример #1
0
    public override void Start(RAIN.Core.AI ai)
    {
        detected = RAIN.Motion.MoveLookTarget.GetTargetFromVariable(ai.WorkingMemory, "nextPosition");
        Debug.Log(detected.Position);
        componentGetter = ai.Body.GetComponent <GetComponents> ();
        moverAgent      = componentGetter.m_agent;
        //moverAgent.destination = detected.Position;

        base.Start(ai);
    }
Пример #2
0
    public override void Start(RAIN.Core.AI ai)
    {
        detected = RAIN.Motion.MoveLookTarget.GetTargetFromVariable(ai.WorkingMemory, "nextPosition");
        Debug.Log(detected.Position);
        componentGetter = ai.Body.GetComponent<GetComponents> ();
        moverAgent = componentGetter.m_agent;
        //moverAgent.destination = detected.Position;

        base.Start(ai);
    }
Пример #3
0
    public override ActionResult Execute(AI ai)
    {
        if (!ai.WorkingMemory.ItemExists("patrolTargetVec"))
        {
            RAIN.Motion.MoveLookTarget mlt = ai.WorkingMemory.GetItem("patrolTarget").GetValue <RAIN.Motion.MoveLookTarget> ();
            ai.WorkingMemory.SetItem("patrolTargetVec", mlt.Position);
        }
        moveToPos = ai.WorkingMemory.GetItem("patrolTargetVec").GetValue <Vector3> ();
//		Debug.Log (moveToPos);

        ai.Motor.moveTarget.VectorTarget = moveToPos;
        ai.Motor.Allow3DRotation         = false;

        if (!ai.Motor.Move())
        {
            return(ActionResult.RUNNING);
        }
        else
        {
            ai.WorkingMemory.RemoveItem("patrolTargetVec");
            return(ActionResult.SUCCESS);
        }
    }