コード例 #1
0
ファイル: WaterHelper.cs プロジェクト: Elizafur/FPS-Transfer
    private void OnTriggerEnter(Collider other)
    {
        player   = other.GetComponent <PlayerController>();
        swimming = player.GetSwimmingMovement();

        if (swimming == null)
        {
            return;                   //if you didn't get a component then it will be null so don't continue
        }
        playerInWater = true;
        swimming.AddWaterHelper(this);
    }
コード例 #2
0
    public void AddMovementType(MovementType move)
    {
        if (movements == null)
        {
            movements = new List <MovementType>();
        }
        move.SetPlayerComponents(movement, playerInput);

        if ((move as WallrunMovement) != null) //If this move type is a Wallrunning
        {
            wallrun = (move as WallrunMovement);
        }
        else if ((move as SurfaceSwimmingMovement) != null) //If this move type is a Surface Swimming
        {
            swimming = (move as SurfaceSwimmingMovement);
        }

        movements.Add(move);
    }
コード例 #3
0
 public override void SetPlayerComponents(PlayerMovement move, PlayerInput input)
 {
     base.SetPlayerComponents(move, input);
     swimming = GetComponent <SurfaceSwimmingMovement>();
 }