示例#1
0
        public void Activate(Entity playerEntity, Entity otherEntity)
        {
            CharacterSpriteComponent spriteComp = playerEntity.GetComponent <CharacterSpriteComponent> ();

            spriteComp.LookAt((Entity)Entity);

            LookHandler.StartLook(playerEntity, (Entity)Entity);
        }
示例#2
0
        public void Activate(Entity playerEntity, Entity otherEntity)
        {
            var entity = (Entity)Entity;
            var model  = entity.Model;

            CharacterSpriteComponent spriteComp = playerEntity.GetComponent <CharacterSpriteComponent> ();

            spriteComp.LookAt(otherEntity);

            GiveHandler.StartGive(playerEntity, entity, otherEntity);
        }
示例#3
0
        public void Activate(Entity playerEntity, Entity otherEntity)
        {
            Entity entity = (Entity)Entity;

            Console.WriteLine($"Picking up {entity.Name}");

            CharacterSpriteComponent spriteComp = playerEntity.GetComponent <CharacterSpriteComponent> ();

            spriteComp.LookAt(entity);

            CollectHandler.StartCollect(playerEntity, entity);
        }
示例#4
0
        public void FollowPath(GKGraphNode[] path, Action <bool> completion)
        {
            if (path == null)
            {
                completion(false);
                return;
            }

            CharacterSpriteComponent comp = Entity.GetComponent <CharacterSpriteComponent> ();

            if (comp == null)
            {
                completion(false);
                return;
            }

            var dropFirst             = path.Skip(1);
            Queue <SKAction> sequence = new Queue <SKAction> ();
            var sprite = comp.Sprite;

            sprite.RemoveActionForKey(WalkingKey);

            foreach (MapGraphNode node in dropFirst)
            {
                Entity centity              = (Entity)Entity;
                CoreGraphics.CGPoint point  = GameViewController.CurrentScene.CurrentMap.PositionToPoint(node.NodePosition, true);
                List <SKAction>      subseq = new List <SKAction> ();

                subseq.Add(SKAction.Run(() => {
                    comp.Direction = centity.Model.StartPosition.DirectionToPosition(node.NodePosition);
                    centity.Model.StartPosition = node.NodePosition;
                    sprite.ZPosition            = GameViewController.CurrentScene.CurrentMap.ZLevelForPosition(node.NodePosition);
                    comp.Walking = true;
                }));

                subseq.Add(SKAction.MoveTo(point, 0.8));

                sequence.Enqueue(SKAction.Sequence(subseq.ToArray()));
            }

            sequence.Enqueue(SKAction.Run(() => comp.Walking = false));
            if (completion != null)
            {
                sequence.Enqueue(SKAction.Run(() => completion(true)));
            }

            currentWalk = sequence;
            if (!comp.Walking)
            {
                RunNextStep(sprite);
            }
        }
示例#5
0
        public void Activate(Entity playerEntity, Entity otherEntity)
        {
            var entity = (Entity)Entity;
            var model  = entity.Model;

            var conversation = model.CurrentConversation;

            if (conversation == null)
            {
                return;
            }

            CharacterSpriteComponent spriteComp = playerEntity.GetComponent <CharacterSpriteComponent> ();

            spriteComp.LookAt((Entity)Entity);

            ConversationHandler.StartConversation(playerEntity, (Entity)Entity, conversation.Item1, conversation.Item2);
        }