示例#1
0
 void Start()
 {
     myState = BehaviorState.idle;
     stateMachine = gameObject.GetComponent<AnimalStateMachine>();
     animalMap = GameObject.FindGameObjectWithTag("Map").GetComponent<AnimalMap>();
     body = gameObject.GetComponent<FlyingAnimalBody>();
     sensory = gameObject.GetComponent<AnimalSensory>();
 }
    public void InitializeMe()
    {
        sensory = gameObject.GetComponent<AnimalSensory>();
        body = gameObject.GetComponent<AnimalBody>();
        brain = gameObject.GetComponent<AnimalBrain>();
        stateMachine = gameObject.GetComponent<AnimalStateMachine>();
        possesor = GameObject.FindGameObjectWithTag("Player").GetComponent<PhantomController>();
        moveSpeed = body.moveSpeed;
        isInitialized = true;

        if(stateMachine.myType == AnimalType.prairieDog)
            jumpController = gameObject.GetComponent<JumpController>();
    }
 void Start()
 {
     sensory = gameObject.GetComponent<AnimalSensory>();
     moveSpeed = 5f; // The amount of unity units I move each frame
     moveState = PlatformingState.running;
     jumpController = gameObject.GetComponent<JumpController>();
 }
示例#4
0
 void Start()
 {
     sensory = gameObject.GetComponent<AnimalSensory>();
     gravityAcceleration = 9.8f * rigidbody2D.gravityScale;
     CalculateSmartJump();
 }
 void Start()
 {
     brain = gameObject.GetComponent<AnimalBrain>();
     sensory = gameObject.GetComponent<AnimalSensory>();
 }