// *********************************************************************** // Assembly : Game // Author : Kimch // Created : 2021-04-23 // Description : // Last Modified By : // Last Modified On : // *********************************************************************** // // // *********************************************************************** using System.Collections; using System.Collections.Generic; using UnityEngine; namespace G { /// /// 如来神掌 /// public class SkillPalm : MonoBehaviour { public Transform rising_fire; public Transform rising_fire2; private Collider _collider; private Collider _subCollider; private bool _collisionOn; private bool _showOn; private float _showTime = 1.5f; private void Awake() { _collider = this.GetComponent(); _subCollider = this.transform.Find("death").GetComponent(); } private void OnEnable() { SplashOn(true, 0f, 0.1f); } private void Start() { //_collider.enabled = false; //this.gameObject.SetActive(false); //SplashOn(true, 0f, 0.1f); } /// /// /// /// /// /// public void SplashOn(bool col, float delay2, float delay) { _collisionOn = col; _showTime = 1.5f; Invoke(nameof(ShowOn), delay); } /// /// /// public void SplashOff() { if (_collider.enabled) { _collider.enabled = false; } this.gameObject.SetActive(false); CancelInvoke(nameof(ShowOn)); } public void ShowOn() { if (_collisionOn) { _collider.enabled = false; _subCollider.enabled = true; } //transform.position = _cha1.TransformPoint(Vector3.forward * _dis) + Vector3.up * 0.02f; //transform.rotation = _cha1.rotation; _showOn = true; } private void FixedUpdate() { if (!_showOn) { return; } _showTime -= Time.deltaTime; if (_showTime > 1.3f) { return; } if (_showTime > 1f) { if (_subCollider.enabled) { _subCollider.enabled = false; } if (!_collider.enabled) { _collider.enabled = true; } } else if (_showTime > 0.5f) { if (_collider.enabled) { _collider.enabled = false; } } else if (_showTime > 0f) { if (_collider.enabled) { _collider.enabled = false; } } else { this.gameObject.SetActive(false); this.transform.position = Vector3.up * 100f; } } } }