Beispiel #1
0
    public void Sync(ShitMan.FoodState state)
    {
        TableFoodPos tFood = TableManager.instance.GetPropertiesById <TableFoodPos>(state.tableId);
        Vector3      pos   = tFood.pos;
        Vector3      dir   = tFood.dir;
        Vector3      scale = Vector3.one * state.radius * 2;

        radius               = state.radius;
        transform.position   = pos;
        transform.rotation   = Quaternion.Euler(dir);
        transform.localScale = scale;
    }
Beispiel #2
0
        /*---------------------- active call ------------------*/
        void ActiveFoodPosSync()
        {
            SC_FoodSync msg      = new SC_FoodSync();
            List <Food> foodList = GetFoodList();

            msg.foodStateList = new FoodState[foodList.Count];
            for (int i = foodList.Count - 1; i >= 0; i--)
            {
                FoodState foodState = new FoodState();
                foodState.guid       = foodList[i].guid;
                foodState.radius     = foodList[i].radius;
                foodState.tableId    = foodList[i].tableId;
                msg.foodStateList[i] = foodState;
            }
            SessionManager.Instance.SendToAll(msg);
        }