コード例 #1
0
 protected override void Initialize()
 {
     //Get the list of points
     //GameObject[] patrolPoints = GameObject.FindGameObjectsWithTag ("Patrol Point");
     //Get the target enemy(Player)
     //objTarget = GameObject.FindGameObjectsWithTag ("Target");
     animator   = GetComponent <Animator>();
     animalStat = GetComponent <AnimalStat>();
     ai         = GetComponent <AnimalMove>();
 }
コード例 #2
0
ファイル: AnimalManager.cs プロジェクト: zuojiashun/src
    public void AddAnimal(IAnimal animal)
    {
        if (animal == null)
        {
            return;
        }

        AnimalMove move = new AnimalMove(animal);

        // 设置移动属性
        animal.SetProp((int)WorldObjProp.MoveSpeed, ClientGlobal.Instance().MainPlayer.GetProp((int)WorldObjProp.MoveSpeed));
        move.m_Animal = animal;

        move.state = AnimalMove.State.Idle;

        animal.SendMessage(EntityMessage.EntityCommand_SetPos, GetRandomPos());
        m_Animals.Add((int)move.m_Animal.GetID(), move);
    }
コード例 #3
0
 void Start()
 {
     m_AnimalMove = GameObject.FindObjectOfType <AnimalMove>().gameObject.GetComponent <AnimalMove>();
     m_Player     = Transform.FindObjectOfType <PlayerMove>().transform;
 }