/// <summary> /// 启动/关闭对象脚下光圈特效 by吴江 /// </summary> /// <param name="_color"></param> /// <param name="_active"></param> public void DoRingEffect(Color _color, bool _active, float _radius) { if (_active) { if (ring != null) { GameCenter.spawner.DespawnRingEffecter(ring); ring = null; } ring = GameCenter.spawner.SpawnRingEffecter(new Vector3(0, ringDiff, 0), Quaternion.identity, this.gameObject.transform, _color); if (ring != null) { ring.gameObject.SetMaskLayer(this.gameObject.layer); ring.gameObject.transform.localScale = new Vector3(_radius * ringScale, 1, _radius * ringScale); } } else { if (ring != null) { ring.gameObject.transform.localScale = new Vector3(_radius * ringScale, 1, _radius * ringScale); GameCenter.spawner.DespawnRingEffecter(ring); ring = null; } } }
/// <summary> /// 从对象池中取出脚下光圈的对象 by吴江 /// </summary> /// <param name="_pos"></param> /// <param name="_rot"></param> /// <returns></returns> public RingEffecter SpawnRingEffecter(Vector3 _pos, Quaternion _rot, Transform _parent, Color _color) { RingEffecter ringEffecter = ringEffecterPool.Request(_pos, _rot, _parent); if (ringEffecter != null) { if (_parent != null) { ringEffecter.gameObject.layer = _parent.gameObject.layer; } ringEffecter.OnSpawned(_color); } return(ringEffecter); }
/// <summary> /// 将脚下光圈的对象归还到对象池 by吴江 /// </summary> /// <param name="_indicator"></param> public void DespawnRingEffecter(RingEffecter _ringEffecter) { _ringEffecter.OnDespawned(); ringEffecterPool.Return(_ringEffecter); }