Example #1
0
 public override void OnMouseDrag()
 {
     if (moveController.GetMoveable())
     {
         base.OnMouseDrag();
         moveController.UpdateMovePosition(newLocation);
     }
 }
 public void InitCameraController()
 {
     if (PhotonManager.Instance.IsConnect)
     {
         playerMoveController = PhotonManager.Instance.NowPlayerType == PlayerType.Cat ? catMoveController : dogMoveController;
     }
     else
     {
         playerMoveController = PlayerDataManager.Instance.NowPlayerType == PlayerType.Cat ? catMoveController : dogMoveController;
     }
     offset = transform.position - player.transform.position;
     Observable.Interval(System.TimeSpan.FromMilliseconds(100))
     .Where(_ => !playerMoveController.GetMoveable())
     .Subscribe(_ => followPlayer());
     this.FixedUpdateAsObservable()
     .Where(x => playerMoveController.GetMoveable())
     .Subscribe(x => followPlayer());
     this.FixedUpdateAsObservable()
     .Where(x => cameraMoveController.IsDraging)
     .Subscribe(x => rotateAroundPlayer());
 }
Example #3
0
    /// <summary>
    /// プレイヤーの挙動を変更するメソッド
    /// </summary>
    private void playerBehavior()
    {
        if (!playerMoveController.GetMoveable())
        {
            catAnimation.stateProcessor.state.Value = catAnimation.stateIdle;
            return;
        }

        float CatArgs    = transform.rotation.eulerAngles.y;
        float targetArgs = ArgUtility.CastNomalArgByOverArg(ArgUtility.CastPlusArgByMinusArg(playerMoveController.ControllerArg) + mainCamera.transform.rotation.eulerAngles.y);

        if (NumberUtility.BetweenAAndB(CatArgs, targetArgs - ARGS_BUFFER, targetArgs + ARGS_BUFFER))
        {
            moveForwardCat();
        }
        else
        {
            rotateCat(targetArgs);
        }
    }