continuing with combat, sword combos working, not finished, blockign working, need to build blockpush and improving bow combat

This commit is contained in:
2026-09-30 16:39:18 +01:00
parent 7486c8d310
commit 4980fb8128
2095 changed files with 1069655 additions and 652 deletions

View File

@@ -0,0 +1,72 @@
// Copyright (c) 2024 Synty Studios Limited. All rights reserved.
//
// Use of this software is subject to the terms and conditions of the End User Licence Agreement (EULA)
// of the store at which you purchased this asset.
//
// Synty assets are available at:
// http://www.syntystore.com
// http://www.unityassetstore.com
// http://www.fab.com
//
// Sample scripts are included only as examples and are not intended as production-ready.
using UnityEngine;
namespace Synty.Interface.FantasyMenus.Samples
{
/// <summary>
/// Sample credits screen controller
/// </summary>
public class SampleScrollerInputs : MonoBehaviour
{
[Header("References")]
public RectTransform viewport;
public RectTransform content;
[Header("Parameters")]
public float speed;
public float speedChangeIncrement;
public float slowDownDistance = 200;
public float maxSpeed;
Vector3 startPosition;
float startSpeed;
private void Start()
{
startSpeed = speed;
startPosition = content.localPosition;
}
private void Reset()
{
content.localPosition = startPosition;
speed = startSpeed;
}
private void Update()
{
if (UnifiedInput.WasPressedThisFrame(UnifiedKey.UpArrow) || UnifiedInput.WasPressedThisFrame(UnifiedKey.W))
{
speed = Mathf.Clamp( speed - speedChangeIncrement, -maxSpeed, 0);
}
else if (UnifiedInput.WasPressedThisFrame(UnifiedKey.DownArrow) || UnifiedInput.WasPressedThisFrame(UnifiedKey.S))
{
speed = Mathf.Clamp( speed + speedChangeIncrement, 0, maxSpeed);
}
float length = content.sizeDelta.y - viewport.rect.height;
float distanceTraveled = Vector3.Distance(content.localPosition, startPosition);
float distanceLeft = length - distanceTraveled;
if(speed < 0)
{
distanceLeft = distanceTraveled;
}
Vector3 delta = Vector3.up * Mathf.Lerp(speed, 0, Mathf.InverseLerp(slowDownDistance, 0, distanceLeft)) * Time.deltaTime;
content.localPosition = content.localPosition + delta;
}
}
}