mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
50 lines
1.1 KiB
C#
50 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
|
|
namespace NewHorizons.Components
|
|
{
|
|
public class RotateToCustomAstroObject : RotateToPoint
|
|
{
|
|
private void FixedUpdate()
|
|
{
|
|
if (this._quaternionTargetMode)
|
|
{
|
|
this._hasTargetLock = base.CheckLockedOn();
|
|
this.IncrementalRotate(Time.fixedDeltaTime);
|
|
return;
|
|
}
|
|
if (this._astroObjectLock == AstroObject.Name.None)
|
|
{
|
|
this._hasTargetLock = false;
|
|
return;
|
|
}
|
|
AstroObject astroObject = Locator.GetAstroObject(this._astroObjectLock);
|
|
if (astroObject == null)
|
|
{
|
|
this._hasTargetLock = false;
|
|
return;
|
|
}
|
|
this._target = astroObject.transform.position;
|
|
this._hasTargetLock = base.CheckLockedOn();
|
|
this.IncrementalRotate(Time.fixedDeltaTime);
|
|
}
|
|
|
|
public void SetNewAstroTarget(AstroObject.Name name, string customName, bool resetRampUp)
|
|
{
|
|
if (resetRampUp)
|
|
{
|
|
base.ResetRotationSpeed(resetRampUp);
|
|
}
|
|
_astroObjectLock = name;
|
|
_astroObjectCustomName = customName;
|
|
}
|
|
|
|
private AstroObject.Name _astroObjectLock;
|
|
private string _astroObjectCustomName;
|
|
}
|
|
}
|