140 lines
2.3 KiB
C#
140 lines
2.3 KiB
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.Serialization;
|
|
|
|
public class MovingPlatforme : CoreBehaviour
|
|
{
|
|
[Header("Move Position")]
|
|
public float moveDuration;
|
|
|
|
[SerializeField]
|
|
[FormerlySerializedAs("moveDelta")]
|
|
private Vector3 _moveDelta;
|
|
|
|
[SerializeField]
|
|
[FormerlySerializedAs("moveCurve")]
|
|
private AnimationCurve _moveCurve;
|
|
|
|
[Header("Move Rotation")]
|
|
[Space(3f)]
|
|
public float moveRotationDuration;
|
|
|
|
[SerializeField]
|
|
[FormerlySerializedAs("rotationDelta")]
|
|
private Vector3 _rotationDelta;
|
|
|
|
[Space(3f)]
|
|
[Header("General")]
|
|
[SerializeField]
|
|
[FormerlySerializedAs("local")]
|
|
private bool _local;
|
|
|
|
[SerializeField]
|
|
[FormerlySerializedAs("delayBeforeStart")]
|
|
private float _delayBeforeStart;
|
|
|
|
[SerializeField]
|
|
[FormerlySerializedAs("triggerMoving")]
|
|
private TriggerMovingPlatforme _triggerMoving;
|
|
|
|
[SerializeField]
|
|
[FormerlySerializedAs("pingpong")]
|
|
private bool _pingpong = true;
|
|
|
|
[SerializeField]
|
|
[FormerlySerializedAs("oneLoop")]
|
|
private bool _oneLoop;
|
|
|
|
private Vector3 _p1;
|
|
|
|
private Vector3 P2;
|
|
|
|
private Quaternion _r1;
|
|
|
|
private Quaternion R2;
|
|
|
|
private Vector3 rotationSpeed;
|
|
|
|
private bool _inverseRot;
|
|
|
|
private Rigidbody _bodyToMove;
|
|
|
|
private float _currentTimeDelay;
|
|
|
|
private float _currentTimeMove;
|
|
|
|
private float _currentTimeMoveRotation;
|
|
|
|
private float _currentTimeMoveRotationPingPong;
|
|
|
|
private bool _isInit;
|
|
|
|
private Vector3 _startPos;
|
|
|
|
private Quaternion startRot;
|
|
|
|
private List<AIBase> _listAIAttch = new List<AIBase>();
|
|
|
|
private float _ratio;
|
|
|
|
private bool _needRotate = true;
|
|
|
|
private bool _curR;
|
|
|
|
public bool Started { get; private set; }
|
|
|
|
public Vector3 curLookDir { get; private set; }
|
|
|
|
public Vector3 curLookDir1 { get; private set; }
|
|
|
|
public Vector3 curLookDir2 { get; private set; }
|
|
|
|
public bool needInverseRot => false;
|
|
|
|
public void AttachAI(AIBase ai)
|
|
{
|
|
}
|
|
|
|
public void StopAllAI()
|
|
{
|
|
}
|
|
|
|
private void Awake()
|
|
{
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
}
|
|
|
|
public void ResetMovingPlatform()
|
|
{
|
|
}
|
|
|
|
public void ActivatePlateforme(bool active)
|
|
{
|
|
}
|
|
|
|
public void Activate(bool active)
|
|
{
|
|
}
|
|
|
|
private Vector3 GetGlobalPosition(Vector3 p)
|
|
{
|
|
return default(Vector3);
|
|
}
|
|
|
|
private Quaternion GetGlobalRotation(Quaternion r)
|
|
{
|
|
return default(Quaternion);
|
|
}
|
|
|
|
private void FixedUpdate()
|
|
{
|
|
}
|
|
|
|
private void OnDrawGizmos()
|
|
{
|
|
}
|
|
}
|