예제 #1
0
        void Start()
        {
            wander = GetComponent <WanderPlusAvoid>();
            if (wander == null)
            {
                Debug.LogError(gameObject + " has no WanderPlusAvois attached in " + this);
            }

            arrive = GetComponent <ArrivePlusAvoid>();
            if (arrive == null)
            {
                Debug.LogError(gameObject + " has no ArrivePlusAvoid attached in " + this);
            }

            blackboard = GetComponent <MOUSE_Blackboard>();
            if (blackboard == null)
            {
                blackboard = gameObject.AddComponent <MOUSE_Blackboard>();
            }

            // the global blackboard it's better created by an external agent
            // or (if has to be created here) must come from a class implementing the SINGLETON PATTERN

            wander.enabled = false;
            arrive.enabled = false;
        }
 // Use this for initialization
 void Start()
 {
     RouterExecutor         = GetComponent <FSM_RouteExecutor>();
     MouseBB                = GetComponent <MOUSE_Blackboard>();
     RouterExecutor.enabled = false;
     GOTarjet               = new GameObject("MouseTarget");
 }
예제 #3
0
        void Start()
        {
            flee = GetComponent <FleePlusAvoid>();
            if (flee == null)
            {
                Debug.LogError(gameObject + " has no FleePlusAvoid attached in " + this);
            }

            KS = GetComponent <KinematicState>();
            if (KS == null)
            {
                Debug.LogError(gameObject + " has no Kinematic state attached in " + this);
            }
            normalSpeed = KS.maxSpeed;
            normalAcc   = KS.maxAcceleration;


            fsmMouseFeed = GetComponent <FSM_MOUSE_FEED> ();
            if (fsmMouseFeed == null)
            {
                fsmMouseFeed = gameObject.AddComponent <FSM_MOUSE_FEED>();
            }

            blackboard = GetComponent <MOUSE_Blackboard>();
            if (blackboard == null)
            {
                blackboard = gameObject.AddComponent <MOUSE_Blackboard>();
            }

            flee.enabled         = false;
            fsmMouseFeed.enabled = false;
        }
 public override void Exit()
 {
     MouseBB = GetComponent <MOUSE_Blackboard>();
     RouterExecutor.target  = null;
     RouterExecutor.enabled = false;
     base.Exit();
 }
 // Use this for initialization
 void Start()
 {
     mySpriteRenderer       = GetComponent <SpriteRenderer>();
     FSMMOuse               = GetComponent <FSM_Mouse>();
     RouterExecutor         = GetComponent <FSM_RouteExecutor>();
     MouseBB                = GetComponent <MOUSE_Blackboard>();
     FSMMOuse.enabled       = false;
     RouterExecutor.enabled = false;
 }
예제 #6
0
        void Start()
        {
            blackboard = GetComponent <MOUSE_Blackboard>();
            if (blackboard == null)
            {
                blackboard = gameObject.AddComponent <MOUSE_Blackboard>();
            }

            fsmMouseAware = GetComponent <FSM_MOUSE_AWARE> ();
            if (fsmMouseAware == null)
            {
                fsmMouseAware = gameObject.AddComponent <FSM_MOUSE_AWARE>();
            }

            fsmMouseAware.enabled = false;
        }