コード例 #1
0
ファイル: Zombie.cs プロジェクト: catunlock/Ourcraft
    public override void Start()
    {
        EntityManager.Instance.RegisterEntity(this);

        cSteeringWander  = GetComponent <UnitySteer.Behaviors.SteerForWander>();
        cSteeringPursuit = GetComponent <UnitySteer.Behaviors.SteerForPursuit>();
        animator         = GetComponent <Animator>();
        biped            = GetComponent <UnitySteer.Behaviors.Biped>();
        rb    = GetComponent <Rigidbody>();
        audio = GetComponent <AudioSource>();

        target  = null;
        targets = new HashSet <BaseGameEntity>();
        cSteeringWander.enabled  = true;
        cSteeringPursuit.enabled = false;
        animator.SetFloat("MoveSpeed", 0);
    }
コード例 #2
0
ファイル: Animal.cs プロジェクト: catunlock/Ourcraft
    public override void Start()
    {
        EntityManager.Instance.RegisterEntity(this);

        cSteeringWander   = GetComponent <UnitySteer.Behaviors.SteerForWander>();
        cSteeringEvasion  = GetComponent <UnitySteer.Behaviors.SteerForEvasion>();
        cSteeringCohesion = GetComponent <UnitySteer.Behaviors.SteerForNeighborGroup>();
        animator          = GetComponent <Animator>();
        biped             = GetComponent <UnitySteer.Behaviors.Biped>();
        biped.MaxSpeed    = normalSpeed;
        rb    = GetComponent <Rigidbody>();
        audio = GetComponent <AudioSource>();

        cSteeringWander.enabled   = true;
        cSteeringEvasion.enabled  = false;
        cSteeringCohesion.enabled = true;
        animator.SetFloat("MoveSpeed", 0);

        //timeForNextReproduction = reproductionCooldown;
        timeForNextReproduction = 0;
    }
コード例 #3
0
 private void Awake()
 {
     currTime = 0f;
     wanderUS = GetComponent<SteerForWander> ();
     avoidUS = GetComponent<SteerForSphericalObstacles> ();
 }
コード例 #4
0
 private void Awake()
 {
     currTime = 0f;
     wanderUS = GetComponent <SteerForWander> ();
     avoidUS  = GetComponent <SteerForSphericalObstacles> ();
 }