Example #1
0
        protected void OnMovementFinished(object data)
        {
            var toDo = data as ActionArea;

            if (toDo != null)
            {
                switch (toDo.action.getType())
                {
                case Action.USE:
                case Action.USE_WITH:
                case Action.GRAB:
                    representable.Orientation = (scenePositioner.Position - toDo.area.ToRect().center).ToOrientation(true);
                    representable.Play("use", "stand");
                    break;

                case Action.CUSTOM:
                    representable.Orientation = (scenePositioner.Position - toDo.area.ToRect().center).ToOrientation(true);
                    representable.Play("actionAnimation", "stand");
                    break;
                }

                if (onExecutionStarted != null)
                {
                    onExecutionStarted(toDo.action);
                }
                Game.Instance.Execute(new EffectHolder(toDo.action.Effects), FinishedCallbackFor(toDo, onExecutionFinished));
            }
        }
Example #2
0
 protected void Start()
 {
     representable = GetComponent <Representable>();
     if (representable)
     {
         representable.Play("stand");
     }
 }
Example #3
0
 protected void Start()
 {
     representable   = GetComponent <Representable>();
     scenePositioner = GetComponent <ScenePositioner>();
     if (scenePositioner)
     {
         representable.Play("stand");
     }
 }
Example #4
0
        // Private movement management methods

        private void AbortCurrentMovement()
        {
            toArea = null;
            if (moving)
            {
                representable.Play("stand");
                // Clear the main variables
                moving   = false;
                progress = 0.0f;
                moves.Clear();
                // Notify the chidls
                if (onMovementCancelled != null)
                {
                    onMovementCancelled(data);
                }

                onMovementCancelled = null;
                onMovementFinished  = null;
                data = null;
            }
        }
 protected override void Start()
 {
     base.Start();
     representable = GetComponent <Representable>();
     representable.Play("stand");
 }