// Token: 0x06000222 RID: 546 RVA: 0x0000AA1C File Offset: 0x00008C1C public static ScriptPlayable <ParticlePrefabControl> Create( PlayableGraph graph, GameObject prefabGameObject , Transform parentTransform , Vector3 localPos , FxFollowType followType , bool initResetRotate , float realLife , float scaleFactor ) { ScriptPlayable <ParticlePrefabControl> result; if (prefabGameObject == null) { result = ScriptPlayable <ParticlePrefabControl> .Null; } else { ScriptPlayable <ParticlePrefabControl> scriptPlayable = ScriptPlayable <ParticlePrefabControl> .Create(graph, 0); scriptPlayable.GetBehaviour().Initialize(prefabGameObject, parentTransform, localPos, followType, initResetRotate, realLife, scaleFactor); result = scriptPlayable; } return(result); }
// Token: 0x06000222 RID: 546 RVA: 0x0000AA1C File Offset: 0x00008C1C /// <summary> /// /// </summary> /// <param name="graph"></param> /// <param name="prefabGameObject"></param> /// <param name="startTransform">from attacker</param> /// <param name="endTransform">to target</param> /// <param name="startOffset"></param> /// <param name="endOffset"></param> /// <param name="followType"></param> /// <param name="initResetRotate"></param> /// <param name="realLife"></param> /// <returns></returns> public static ScriptPlayable <FlyParticlePrefabControl> Create( PlayableGraph graph, GameObject prefabGameObject , Transform startTransform , Transform endTransform , Vector3 startOffset , Vector3 endOffset , FxFollowType followType , bool initResetRotate , float realLife , float duration , bool revert , float scaleFactor ) { ScriptPlayable <FlyParticlePrefabControl> result; if (prefabGameObject == null) { result = ScriptPlayable <FlyParticlePrefabControl> .Null; } else { ScriptPlayable <FlyParticlePrefabControl> scriptPlayable = ScriptPlayable <FlyParticlePrefabControl> .Create(graph, 0); scriptPlayable.GetBehaviour().Initialize(prefabGameObject, startTransform, endTransform, startOffset, endOffset, followType, initResetRotate, realLife, duration, revert, scaleFactor); result = scriptPlayable; } return(result); }
public void InitData(float life, FxFollowType followType, Transform followTrans, Vector3 offset) { this.life = life; this.followType = followType; this.followTrans = followTrans; if (followType != FxFollowType.none) { posOffset = offset; } else { posOffset = transform.position; rotateOffset = transform.rotation; } }
// Token: 0x06000224 RID: 548 RVA: 0x0000AA7C File Offset: 0x00008C7C void Initialize(GameObject prefabGameObject , Transform startTransform , Transform endTransform , Vector3 startOffsetInWorld , Vector3 endOffsetInWorld , FxFollowType followType , bool initResetRotate , float realLife , float duration , bool revert , float scaleFactor ) { if (startTransform == null || endTransform == null) { return; } if (prefabGameObject == null) { throw new System.ArgumentNullException("Prefab cannot be null"); } if (this.m_Instance != null) { Debug.LogWarningFormat("Prefab Control Playable ({0}) has already been initialized with a Prefab ({1}).", new object[] { prefabGameObject.name, this.m_Instance.name }); } else { this.m_Instance = Object.Instantiate <GameObject>(prefabGameObject); this.m_Instance.name = prefabGameObject.name + " [Timeline]"; this.m_Instance.SetActive(false); ParticleScaleUtility.ScaleEffectNode(this.m_Instance, scaleFactor); this.m_StartTrans = startTransform; if (this.m_StartTrans != null) { var anim = ParticleCtrlUtilities.FindAnimInParent(m_StartTrans); if (anim != null) { this.m_StartRole = anim.transform; } } this.m_EndTrans = endTransform; if (this.m_EndTrans != null) { var anim = ParticleCtrlUtilities.FindAnimInParent(m_EndTrans); if (anim != null) { this.m_EndRole = anim.transform; } } this.m_StartPosOffsetInWorld = startOffsetInWorld; this.m_EndPosOffsetInWorld = endOffsetInWorld; this.m_followType = followType; this.m_initResetRotate = initResetRotate; this.m_realLife = realLife; this.m_duration = duration; this.m_revert = revert; //float roleScale = 1f; if (startTransform != null) { var roleAnim = ParticleCtrlUtilities.FindAnimInParent(startTransform); if (roleAnim != null) { this.m_Instance.transform.SetParent(roleAnim.transform.parent); //roleScale = roleAnim.transform.lossyScale.x; } } //ParticleScaleUtility.ScaleEffectNode(this.m_Instance, scaleFactor * roleScale); //if (m_ParentTrans != null) //{ // m_Instance.transform.position = m_ParentTrans.position + m_PosOffsetInWorld; // if( initResetRotate) // m_Instance.transform.rotation = Quaternion.identity; // else // m_Instance.transform.rotation = m_ParentTrans.rotation; // m_Instance.transform.localScale = m_ParentTrans.lossyScale; //} else //{ // m_Instance.transform.position = m_PosOffsetInWorld; // m_Instance.transform.rotation = Quaternion.identity; // m_Instance.transform.localScale = Vector3.one; //} ParticlePrefabControl.SetHideFlagsRecursive(this.m_Instance); } }