Пример #1
0
        public void Setup()
        {
            agent     = new GameObject();
            behaviour = agent.AddComponent <DotToTransform>();
            agent.transform.position = new Vector3(0, 0, 0);

            planarParameters.ContextMapRotationAxis = RotationAxis.YAxis;
            planarParameters.ContextMapResolution   = 4;
            behaviour.BehaviourName = "Test behaviour";

            behaviour.InstantiateContextMap(planarParameters);

            targetOne = new GameObject();
            targetOne.transform.position = new Vector3(0, 0, 5);

            targetTwo = new GameObject();
            targetTwo.transform.position = new Vector3(5, 0, 0);

            targetThree = new GameObject();
            targetThree.transform.position = new Vector3(0, 0, 0);



            behaviour.Positions = new Transform[] { targetOne.transform, targetTwo.transform, targetThree.transform };
        }
Пример #2
0
        public void Setup()
        {
            agent      = new GameObject();
            controller = agent.AddComponent <PlanarSteeringController>();
            behaviour  = agent.AddComponent <DotToTransform>();

            controller.steeringParameters = new PlanarSteeringParameters();
            controller.steeringParameters.ContextMapResolution   = 4;
            controller.steeringParameters.ContextMapRotationAxis = RotationAxis.YAxis;

            TestUtilities.CallNonPublicMethod <ICombineContext>(controller, "SetContextCombinator", new BasicContextCombinator());
            TestUtilities.CallNonPublicMethod <IDecideDirection>(controller, "SetDirectionDecider", new BasicPlanarDirectionPicker(true, controller.steeringParameters));
            behaviour.BehaviourName = "Test behaviour";

            target = new GameObject();
            target.transform.position = new Vector3(0, 0, 5);

            behaviour.Positions = new Transform[] { target.transform };

            controller.Awake();
        }