private GameObject InstantiateNewEffect()
        {
            if (Owner == null)
            {
                return(null);
            }

            if (!string.IsNullOrEmpty(MountPointName.Trim()) && (m_MountPointTransform == null || m_MountPointTransform.name != MountPointName.Trim()))
            {
                m_MountPointTransform = SystemTools.FindChildByName(MountPointName, Owner.transform);
            }

            if (m_MountPointTransform == null)
            {
                m_MountPointTransform = Owner.transform;
            }

            Vector3 _position = m_MountPointTransform.position;
            Vector3 _offset   = Vector3.zero;

            if (OffsetType == RandomOffsetType.EXACT)
            {
                _offset = Offset;
            }
            else if (OffsetRadius > 0)
            {
                Vector2 _pos = Random.insideUnitCircle * OffsetRadius;

                _offset.x = _pos.x;
                _offset.z = _pos.y;

                if (OffsetType == RandomOffsetType.HEMISPHERE)
                {
                    _offset.y = Random.Range(0, OffsetRadius);
                }
                else if (OffsetType == RandomOffsetType.SPHERE)
                {
                    _offset.y = Random.Range(-OffsetRadius, OffsetRadius);
                }
            }

            _position = PositionTools.FixTransformPoint(m_MountPointTransform, _offset);

            GameObject _effect = (GameObject)Object.Instantiate(ReferenceObject, _position, Quaternion.identity);

            if (_effect != null)
            {
                _effect.name = ReferenceObject.name;

                if (m_MountPointTransform != null)
                {
                    _effect.transform.rotation = m_MountPointTransform.rotation * Rotation;
                }
                else
                {
                    _effect.transform.rotation = Rotation;
                }

                if (Detach == false)
                {
                    _effect.transform.SetParent(m_MountPointTransform, true);
                }

                _effect.SetActive(true);
            }

            return(_effect);
        }
        private GameObject InstantiateEffect()
        {
            if (Owner == null || !Enabled || ReferenceObject == null)
            {
                return(null);
            }

            if (!string.IsNullOrEmpty(MountPointName.Trim()) && (m_MountPointTransform == null || m_MountPointTransform.name != MountPointName.Trim()))
            {
                m_MountPointTransform = SystemTools.FindChildByName(MountPointName, Owner.transform);
            }

            if (m_MountPointTransform == null)
            {
                m_MountPointTransform = Owner.transform;
            }

            Vector3 _position = m_MountPointTransform.position;
            Vector3 _offset   = Vector3.zero;

            if (OffsetType == RandomOffsetType.EXACT)
            {
                _offset = Offset;
            }
            else if (OffsetRadius > 0)
            {
                Vector2 _pos = Random.insideUnitCircle * OffsetRadius;

                _offset.x = _pos.x;
                _offset.z = _pos.y;

                if (OffsetType == RandomOffsetType.HEMISPHERE)
                {
                    _offset.y = Random.Range(0, OffsetRadius);
                }
                else if (OffsetType == RandomOffsetType.SPHERE)
                {
                    _offset.y = Random.Range(-OffsetRadius, OffsetRadius);
                }
            }

            _position = PositionTools.FixTransformPoint(m_MountPointTransform, _offset);

            GameObject _effect = WorldManager.Instantiate(ReferenceObject, _position, Rotation);

            if (_effect != null)
            {
                _effect.name = ReferenceObject.name;

                if (m_MountPointTransform != null)
                {
                    _effect.transform.rotation = m_MountPointTransform.rotation * Rotation;
                }
                else
                {
                    _effect.transform.rotation = Rotation;
                }

                _effect.SetActive(true);

                if (Attached == true && m_MountPointTransform != null && Owner.activeInHierarchy)
                {
                    _effect.transform.SetParent(m_MountPointTransform, true);
                }
                else if (Attached == false && Lifetime > 0)
                {
                    WorldManager.Destroy(_effect, Lifetime);
                    _effect = null;
                }
            }

            return(_effect);
        }