예제 #1
0
        //Move camera to item position/ root container
        public void OnInventoryMoveServer(InventoryMove info)
        {
            if (isInteliCard == false || LinkedPlayer == null)
            {
                return;
            }

            //Leaving inventory and to no slot, therefore going to floor
            if (info.ToRootPlayer == null && info.ToSlot == null)
            {
                linkedPlayer.ServerSetCameraLocation(linkedPlayer.gameObject, true);
                return;
            }

            //Going to a new player
            if (info.ToRootPlayer != null)
            {
                linkedPlayer.ServerSetCameraLocation(info.ToRootPlayer.gameObject, true);
                return;
            }

            //Else must be container so follow container
            linkedPlayer.ServerSetCameraLocation(info.ToSlot.GetRootStorage().gameObject, true);
        }