예제 #1
0
 void Start()
 {
     controller = GetComponent <ActorMove>();
     if (controller != null)
     {
         controller.SetActorState(seekerState);
         controller.SetGroup(group);
     }
 }
예제 #2
0
    void initComponent()
    {
        gameObject.AddComponent <ActorBuffAndSkill> ();

        eye  = gameObject.AddComponent <ActorEye> ();
        foot = gameObject.AddComponent <ActorMove> ();

        hand = gameObject.AddComponent <ActorHand> ();
    }
예제 #3
0
    // 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);
        }
    }
예제 #4
0
    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());
    }