void Start() { controller = GetComponent <ActorMove>(); if (controller != null) { controller.SetActorState(seekerState); controller.SetGroup(group); } }
void initComponent() { gameObject.AddComponent <ActorBuffAndSkill> (); eye = gameObject.AddComponent <ActorEye> (); foot = gameObject.AddComponent <ActorMove> (); hand = gameObject.AddComponent <ActorHand> (); }
// Use this for initialization void Start() { Pos = new Vector2(transform.position.x - PathFind.instance.m_map.mapStartPos.x, transform.position.z - PathFind.instance.m_map.mapStartPos.z); neighbourRadiusSquaredMoving = neighbourRadiusMoving * neighbourRadiusMoving; neighbourRadiusSquaredIdle = neighbourRadiusIdle * neighbourRadiusIdle; SetNeighbourRadius(seekerState); neighbours = new Seeker[SeekerMovementManager.maxNeighbourCount]; SeekerMovementManager.AddSeeker(this); controller = GetComponent <ActorMove>(); if (controller != null) { controller.SetActorState(seekerState); controller.SetGroup(group); } }
private void OnActorMove(SocketAsyncEventArgs args, byte[] bytes) { ActorMove input = ActorMove.Parser.ParseFrom(bytes); if (input.RoomId != RoomId) { return; // 不是自己房间的消息,略过 } if (input.CellIndexFrom == 0 || input.CellIndexTo == 0) { Debug.LogError("RoomLogic OnActorMove Error - Actor position is lost!"); } ActorMoveReply output = new ActorMoveReply() { RoomId = input.RoomId, OwnerId = input.OwnerId, ActorId = input.ActorId, CellIndexFrom = input.CellIndexFrom, CellIndexTo = input.CellIndexTo, Ret = true, }; BroadcastMsg(ROOM_REPLY.ActorMoveReply, output.ToByteArray()); }