Пример #1
0
 void SetMonitorPullParamsFreeMove()
 {
     doPlayerStateStuff  = ClickSetTargetVector;
     doPlayerStateStuff += HandleVSliding;
     doPlayerStateStuff += HandleHRestedSliding;
     doPlayerStateStuff += MonitorXBoostStart;
 }
Пример #2
0
    void SetPlayerStateParams()
    {
        Debug.Log("state switching to " + currentPlayerState);
        switch (currentPlayerState)
        {
        case playerStates.Resting:
            setRestingParams();
            break;

        case playerStates.MonitorPull:
            setMonitorPullParams();
            break;

        case playerStates.Grabbed:
            setGrabbedParams();
            break;

        case playerStates.BoostOnEndDrag:
            setBoostOnEndDragParams();
            break;

        case playerStates.InBoost:
            setInBoostParams();
            break;

        case playerStates.BoostStarted:
            setBoostStartedParams();
            break;

        default:
            setRestingParams();
            break;
        }
        doStateStuff = doPlayerStateStuff;
    }
Пример #3
0
 void SetRestingParamsLines()
 {
     gameVars.playerDefaultX = gameVars.PlayerRestingPosition;
     doPlayerStateStuff      = HandleHRestedSliding;
     doPlayerStateStuff     += HandleVSliding;
     doPlayerStateStuff     += MonitorVerticalSwipe;
 }
Пример #4
0
 void SetRestingParamsFreeMove()
 {
     gameVars.playerDefaultX = gameVars.PlayerRestingPosition;
     doPlayerStateStuff      = HandleHRestedSliding;
     doPlayerStateStuff     += ClickSetTargetVector;
     doPlayerStateStuff     += HandleVSliding;
 }
Пример #5
0
 public void Game()
 {
     doStateStuff = ScrollBackground;
     if (locomotion)
     {
         doStateStuff += SendResetMsg;
     }
 }
Пример #6
0
 void SetInBoostParamsLines()
 {
     StartBoost();
     doPlayerStateStuff  = HandleVSliding;
     doPlayerStateStuff += HandleHBoostedSliding;
     doubleClickTimer    = 0.0f;
     doPlayerStateStuff += TemporizeDoubleClick;
 }
Пример #7
0
 void SetBoostStartedParamsLines()
 {
     doPlayerStateStuff  = null;
     doPlayerStateStuff  = HandleVSliding;
     doPlayerStateStuff += HandleHBoostedSliding;
     doubleClickTimer    = 0.0f;
     doPlayerStateStuff += MonitorDoubleClick;
 }
Пример #8
0
    void SetBoostOnEndDragParamsLines()
    {
        avatar.SetBool("Grabbed", true);
        doPlayerStateStuff = HandleHRestedSliding;
        SetCurrentCollisionState(playerCollisionStates.Invulnerable);

        Invoke("OnEndDrag", 0.5f);
    }
Пример #9
0
 void SetRestingParamsJetpack()
 {
     gameVars.playerDefaultX = gameVars.PlayerRestingPosition;
     doPlayerStateStuff      = HandleHRestedSliding;
     doPlayerStateStuff     += Swim;
     doPlayerStateStuff     += FallAcceleration;
     doPlayerStateStuff     += HandleRotation;
     doPlayerStateStuff     += MonitorJetpackClick;
 }
Пример #10
0
 void SetBoostStartedParamsFreeMove()
 {
     doPlayerStateStuff  = null;
     doPlayerStateStuff  = ClickSetTargetVector;
     doPlayerStateStuff += HandleVSliding;
     doPlayerStateStuff += HandleHBoostedSliding;
     doubleClickTimer    = 0.0f;
     doPlayerStateStuff += MonitorDoubleClick;
 }
Пример #11
0
 void SetInBoostParamsFreeMove()
 {
     StartBoost();
     doPlayerStateStuff  = ClickSetTargetVector;
     doPlayerStateStuff += HandleVSliding;
     doPlayerStateStuff += HandleHBoostedSliding;
     doubleClickTimer    = 0.0f;
     doPlayerStateStuff += TemporizeDoubleClick;
 }
Пример #12
0
 public void Pushed(float pushToY)
 {
     if (pushToY < transform.position.y)
     {
         transform.localScale = new Vector3(transform.localScale.x, -1.0f, transform.localScale.z);
     }
     myAnim.SetTrigger("PushedUp");
     pushToPositionY       = pushToY;
     doObstacleStateStuff += VerticalTranslation;
 }
Пример #13
0
 void SetWaiting()
 {
     doObstacleStateStuff = null;
     transform.position   = new Vector3(startPosition.x, startPosition.y, startPosition.z);
     transform.localScale = baseScale;
     if (myRB2 != null)
     {
         myRB2.WakeUp();
     }
 }
Пример #14
0
 void SetApproaching()
 {
     doObstacleStateStuff  = null;
     doObstacleStateStuff += LinearTranslation;
     doObstacleStateStuff += MonitorInGame;
     if (zTranslationScale)
     {
         doObstacleStateStuff += ZTranslation;
     }
 }
Пример #15
0
 void VerticalTranslation()
 {
     //Debug.Log (gameObject.name + " Vertical T - push to : "+pushToPositionY + "diff : "+Mathf.Abs(transform.position.y - pushToPositionY));
     if (Mathf.Abs(transform.position.y - pushToPositionY) > 0.1f)
     {
         transform.position = new Vector3(transform.position.x, Mathf.Lerp(transform.position.y, pushToPositionY, gsm.gameSpeed * pushForce * Time.deltaTime), transform.position.z);
     }
     else
     {
         doObstacleStateStuff -= VerticalTranslation;
     }
 }
Пример #16
0
 void SetIngame()
 {
     doObstacleStateStuff = null;
     if (linearTranslation)
     {
         doObstacleStateStuff += LinearTranslation;
     }
     if (zTranslationScale)
     {
         doObstacleStateStuff += ZTranslation;
     }
 }
Пример #17
0
 void TranslateFirstBlock()
 {
     if (firstBlock.transform.position.x > -80.0f)
     {
         firstBlock.transform.position = new Vector3(Mathf.Lerp(firstBlock.transform.position.x, firstBlock.transform.position.x - gameVars.linearTranslationOffset, speedManager.GameSpeed * Time.deltaTime),
                                                     firstBlock.transform.position.y, firstBlock.transform.position.z);
     }
     else
     {
         firstBlock.SetActive(false);
         doStateStuff -= TranslateFirstBlock;
     }
 }
Пример #18
0
 void InitBeginningBlock()
 {
     blocksControllers[0].CurrentBlockState = BlockController.blocksState.Approaching;
     nextBlock = blocksControllers [1];
     if (blocksControllers.Count > 1)
     {
         for (int i = 2; i < blocksControllers.Count; i++)
         {
             blocksControllers [i].gameObject.SetActive(false);
         }
     }
     if (firstBlock != null)
     {
         doStateStuff += TranslateFirstBlock;
     }
 }
Пример #19
0
    public void Intro()
    {
        if (activeSpriteList == null)
        {
            activeSpriteList = new BGScalesSpriteList(gameVars, null, null, null);
        }



        doStateStuff = ScrollBackground;
        if (locomotion)
        {
            doStateStuff += SendResetMsg;
        }

        ResetPosition = RestartPosition;
    }
Пример #20
0
 public void Game()
 {
     doStateStuff = UpdateDistance;
 }
Пример #21
0
 public void Pause()
 {
     doStateStuff = null;
 }
Пример #22
0
 void SetMonitorPullParamsLines()
 {
     doPlayerStateStuff  = HandleVSliding;
     doPlayerStateStuff += HandleHRestedSliding;
     doPlayerStateStuff += MonitorXBoostStart;
 }