1118OPSSNew/Assets/Zion/Scripts//ToMainPosition.cs

27 lines
933 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ToMainPosition : PermanentTriggerBase
{
protected override void OnMDown()
{
base.OnMDown();
LiveSceneManager.Instance.firstPersonController.GetComponent<CapsuleCollider>().enabled = false;
LiveSceneManager.Instance.firstPersonController.GetComponent<Rigidbody>().useGravity = false;
LiveSceneManager.Instance.firstPersonController.transform.SetParent(transform);
LiveSceneManager.Instance.firstPersonController.transform.localPosition = Vector3.zero;
LiveSceneManager.Instance.firstPersonController.transform.localRotation = Quaternion.identity;
LiveSceneManager.Instance.firstPersonController.playerCanMove = false;
StepManager.Instance.FinishStep(triggerName);
}
// Start is called before the first frame update
void Start()
{
}
}