コード例 #1
0
 protected static IEnumerator RevokeControlCoroutine(float time, ControlTypeToRevoke controlTypeToRevoke,
                                                     RevokeControlVariables revokeControlVariables,
                                                     bool revoke, MonoBehaviour monoBehaviour)
 {
     for (var i = 0; i < 1; i++)
     {
         RevokeControlSelection(revoke, controlTypeToRevoke, revokeControlVariables, false);
         yield return(new WaitForSeconds(time));
     }
     RevokeControlSelection(revoke, controlTypeToRevoke, revokeControlVariables, true);
     CoroutineManager.FindCoroutine("RevokeControlCoroutine", monoBehaviour).IsRunning = false;
 }
コード例 #2
0
    protected static void RevokeControlSelection(bool revoke, ControlTypeToRevoke controlTypeToRevoke,
                                                 RevokeControlVariables revokeControlVariables, bool negate)
    {
        if (negate)
        {
            revoke = !revoke;
        }

        switch (controlTypeToRevoke)
        {
        case ControlTypeToRevoke.HorizontalMovement:
            revokeControlVariables.horizontalMovementControl = revoke;
            break;

        case ControlTypeToRevoke.VerticalMovement:
            revokeControlVariables.verticalMovementControl = revoke;
            break;

        case ControlTypeToRevoke.LadderMovement:
            revokeControlVariables.ladderMovementControl = revoke;
            break;

        case ControlTypeToRevoke.MiscellaneousMovement:
            revokeControlVariables.miscellaneousMovementControl = revoke;
            break;

        case ControlTypeToRevoke.CombatMovement:
            revokeControlVariables.combatMovementControl = revoke;
            break;

        case ControlTypeToRevoke.AllMovement:
            revokeControlVariables.horizontalMovementControl    = revoke;
            revokeControlVariables.verticalMovementControl      = revoke;
            revokeControlVariables.ladderMovementControl        = revoke;
            revokeControlVariables.miscellaneousMovementControl = revoke;
            revokeControlVariables.combatMovementControl        = revoke;
            break;

        default:
            Debug.Log("ERROR");
            break;
        }
    }
コード例 #3
0
    protected virtual void RevokeControl(float timeToRevoke, bool revoke,
                                         ControlTypeToRevoke controlTypeToRevoke, RevokeControlVariables revokeControlVariables,
                                         MonoBehaviour monoBehaviour)
    {
        var coroutine = CoroutineManager.FindCoroutine("RevokeControlCoroutine", monoBehaviour);

        if (coroutine == null)
        {
            CoroutineManager.AddCoroutine(
                RevokeControlCoroutine(timeToRevoke, controlTypeToRevoke, revokeControlVariables, true, monoBehaviour),
                "RevokeControlCoroutine", monoBehaviour);
        }
        else if (!coroutine.IsRunning)
        {
            CoroutineManager.DeleteCoroutine("RevokeControlCoroutine", monoBehaviour);
            CoroutineManager.AddCoroutine(
                RevokeControlCoroutine(timeToRevoke, controlTypeToRevoke, revokeControlVariables, true, monoBehaviour),
                "RevokeControlCoroutine", monoBehaviour);
        }
    }
コード例 #4
0
 public void RevokeControl(float timeToRevoke, bool revoke, ControlTypeToRevoke controlTypeToRevoke,
                           MonoBehaviour monoBehaviour)
 {
     base.RevokeControl(timeToRevoke, revoke, controlTypeToRevoke, revokeControlVariables, monoBehaviour);
 }
コード例 #5
0
 public void RevokeControl(bool revoke, ControlTypeToRevoke controlTypeToRevoke)
 {
     base.RevokeControl(revoke, controlTypeToRevoke, revokeControlVariables);
 }
コード例 #6
0
 protected virtual void RevokeControl(bool revoke, ControlTypeToRevoke controlTypeToRevoke,
                                      RevokeControlVariables revokeControlVariables)
 {
     RevokeControlSelection(revoke, controlTypeToRevoke, revokeControlVariables, false);
 }