52 lines
1.5 KiB
C#
Raw Normal View History

2025-05-18 01:04:31 +08:00
// ***********************************************************************
// Assembly : Unity
// Author : Kimch
// Created : 2017-11-14
//
// Last Modified By : Kimch
// Last Modified On :
// ***********************************************************************
// <copyright file= "SoulStone_soul" company=""></copyright>
// <summary></summary>
// ***********************************************************************
using UnityEngine;
namespace G
{
public class SoulStone_soul : MonoBehaviour
{
private GameObject cha1;
private Cha_Control_ride_cha _scriptCha;
private void Start()
{
cha1 = GameObject.FindWithTag("Player");
_scriptCha = cha1.GetComponent<Cha_Control_ride_cha>();
transform.rotation = Quaternion.Euler(0f, Random.Range(0, 360), 0f);
}
private void OnTriggerEnter(Collider other)
{
if (other.gameObject == cha1)
{
_scriptCha.GetSoulStone(1);
transform.position = -200f * Vector3.forward;
}
}
private void Update()
{
Vector3 position = this.transform.position;
if (position.z > -0.6f)
{
//this.transform.position += Vector3.forward * -1.8f * Time.deltaTime;
transform.Rotate(Vector3.up * 500f * Time.deltaTime);
}
else
{
//this.transform.position = -2f * Vector3.forward;
}
}
}
}