예제 #1
0
파일: Player.cs 프로젝트: pdxparrot/ggj2019
        public void AddBeeToSwarm(Bee bee)
        {
            Swarm.Add(bee);
            _interactables.RemoveInteractable(bee);

            bee.SetPlayerSkin(this);
        }
예제 #2
0
        public bool CatchSheep()
        {
            if (!HasCapacity)
            {
                return(false);
            }

            Sheep caught = null;

            foreach (Sheep sheep in _interactables)
            {
                if (null != sheep && sheep.CanCatch)
                {
                    caught = sheep;
                    break;
                }
            }

            if (null == caught)
            {
                return(false);
            }

            if (null == _carrying)
            {
                if (!GrabSheep(caught))
                {
                    return(false);
                }
            }
            else if (!caught.IsInQueue && !_onPlatform)
            {
                EnqueueSheep(caught);
            }
            else
            {
                return(false);
            }

            Debug.Log($"Caught sheep {caught.Id}");

            GameManager.Instance.OnSheepCollected();

            _interactables.RemoveInteractable(caught);

            return(true);
        }