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)); } }
protected void Start() { representable = GetComponent <Representable>(); if (representable) { representable.Play("stand"); } }
protected void Start() { representable = GetComponent <Representable>(); scenePositioner = GetComponent <ScenePositioner>(); if (scenePositioner) { representable.Play("stand"); } }
// 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"); }