// *********************************************************************** // Assembly : Game // Author : Kimch // Created : 2020-09-02 // Description : // Last Modified By : // Last Modified On : // *********************************************************************** // // // *********************************************************************** using UnityEngine; namespace G { public class SoulStone_obj : MonoBehaviour { public Transform obj_break; private GameObject _cha1; private Cha_Control_ride_cha _script_cha; private void Start() { _cha1 = GameObject.FindWithTag("Player"); _script_cha = _cha1.GetComponent(); } private void OnTriggerEnter(Collider other) { if (other == _cha1.GetComponent()) { Object.Instantiate(obj_break, transform.position, transform.rotation, this.transform.parent); _script_cha.FallDown(); this.transform.position = -2f * Vector3.forward; } else if (other.gameObject.layer == GameLayer.UnitLayer) { Object.Instantiate(obj_break, transform.position, transform.rotation, this.transform.parent); this.transform.position = -2f * Vector3.forward; } } private void Update() { //Vector3 position = this.transform.position; //if (position.z > -0.6f) //{ // this.transform.position += Vector3.forward * -1.8f * Time.deltaTime; //} //else //{ // this.transform.position = -2f * Vector3.forward; //} } } }