Exemplo n.º 1
0
 public override void OnUpdateEffectSpeed(float fSpeedRate, bool bRuntime)
 {
     if (bRuntime)
     {
         NcEffectBehaviour.AdjustSpeedRuntime(this.m_LinkGameObject, fSpeedRate);
     }
 }
Exemplo n.º 2
0
    private void CreateAttachPrefab(Vector3 position, float size)
    {
        if (this.m_AttachPrefab == null)
        {
            return;
        }
        GameObject gameObject = base.CreateGameObject(this.m_AttachPrefab, this.m_AttachPrefab.transform.position + position, this.m_AttachPrefab.transform.rotation);

        if (gameObject == null)
        {
            return;
        }
        base.ChangeParent(NcEffectBehaviour.GetRootInstanceEffect().transform, gameObject.transform, false, null);
        NcTransformTool.CopyLossyToLocalScale(gameObject.transform.lossyScale * size, gameObject.transform);
        NcEffectBehaviour.AdjustSpeedRuntime(gameObject, this.m_fPrefabSpeed);
        if (0f < this.m_fPrefabLifeTime)
        {
            NcAutoDestruct ncAutoDestruct = gameObject.GetComponent <NcAutoDestruct>();
            if (ncAutoDestruct == null)
            {
                ncAutoDestruct = gameObject.AddComponent <NcAutoDestruct>();
            }
            ncAutoDestruct.m_fLifeTime = this.m_fPrefabLifeTime;
        }
    }
Exemplo n.º 3
0
 public override void OnUpdateEffectSpeed(float fSpeedRate, bool bRuntime)
 {
     this.m_fDuplicateTime     /= fSpeedRate;
     this.m_fDuplicateLifeTime /= fSpeedRate;
     if (bRuntime && this.m_ClonObject != null)
     {
         NcEffectBehaviour.AdjustSpeedRuntime(this.m_ClonObject, fSpeedRate);
     }
 }
Exemplo n.º 4
0
    private void CreateAttachPrefab()
    {
        this.m_nCreateCount++;
        this.m_CreateGameObject = base.CreateGameObject(this.GetTargetGameObject(), (!(this.GetTargetGameObject() == base.get_gameObject())) ? base.get_transform() : null, this.m_AttachPrefab);
        if (this.m_CreateGameObject == null)
        {
            return;
        }
        Vector3 position = this.m_CreateGameObject.get_transform().get_position();

        this.m_CreateGameObject.get_transform().set_position(new Vector3(Random.Range(-this.m_RandomRange.x, this.m_RandomRange.x) + position.x, Random.Range(-this.m_RandomRange.y, this.m_RandomRange.y) + position.y, Random.Range(-this.m_RandomRange.z, this.m_RandomRange.z) + position.z));
        Transform expr_F7 = this.m_CreateGameObject.get_transform();

        expr_F7.set_position(expr_F7.get_position() + this.m_AddStartPos);
        Transform expr_118 = this.m_CreateGameObject.get_transform();

        expr_118.set_localRotation(expr_118.get_localRotation() * Quaternion.Euler(this.m_AccumStartRot.x * (float)this.m_nCreateCount, this.m_AccumStartRot.y * (float)this.m_nCreateCount, this.m_AccumStartRot.z * (float)this.m_nCreateCount));
        GameObject expr_16C = this.m_CreateGameObject;

        expr_16C.set_name(expr_16C.get_name() + " " + this.m_nCreateCount);
        NcEffectBehaviour.SetActiveRecursively(this.m_CreateGameObject, true);
        NcEffectBehaviour.AdjustSpeedRuntime(this.m_CreateGameObject, this.m_fPrefabSpeed);
        if (0f < this.m_fPrefabLifeTime)
        {
            NcAutoDestruct ncAutoDestruct = this.m_CreateGameObject.GetComponent <NcAutoDestruct>();
            if (ncAutoDestruct == null)
            {
                ncAutoDestruct = this.m_CreateGameObject.AddComponent <NcAutoDestruct>();
            }
            ncAutoDestruct.m_fLifeTime = this.m_fPrefabLifeTime;
        }
        if (this.m_bDetachParent)
        {
            NcDetachParent ncDetachParent = this.m_CreateGameObject.GetComponent <NcDetachParent>();
            if (ncDetachParent == null)
            {
                ncDetachParent = this.m_CreateGameObject.AddComponent <NcDetachParent>();
            }
        }
        if ((this.m_fRepeatTime == 0f || this.m_AttachType == NcAttachPrefab.AttachType.Destroy) && 0 < this.m_nRepeatCount && this.m_nCreateCount < this.m_nRepeatCount)
        {
            this.CreateAttachPrefab();
        }
    }
Exemplo n.º 5
0
    private void CreateAttachPrefab()
    {
        this.m_nCreateCount++;
        this.m_CreateGameObject = base.CreateGameObject(this.GetTargetGameObject(), (!(this.GetTargetGameObject() == base.gameObject)) ? base.transform : null, this.m_AttachPrefab);
        if (this.m_CreateGameObject == null)
        {
            return;
        }
        Vector3 position = this.m_CreateGameObject.transform.position;

        this.m_CreateGameObject.transform.position       = new Vector3(UnityEngine.Random.Range(-this.m_RandomRange.x, this.m_RandomRange.x) + position.x, UnityEngine.Random.Range(-this.m_RandomRange.y, this.m_RandomRange.y) + position.y, UnityEngine.Random.Range(-this.m_RandomRange.z, this.m_RandomRange.z) + position.z);
        this.m_CreateGameObject.transform.position      += this.m_AddStartPos;
        this.m_CreateGameObject.transform.localRotation *= Quaternion.Euler(this.m_AccumStartRot.x * (float)this.m_nCreateCount, this.m_AccumStartRot.y * (float)this.m_nCreateCount, this.m_AccumStartRot.z * (float)this.m_nCreateCount);
        GameObject expr_16C = this.m_CreateGameObject;

        expr_16C.name = expr_16C.name + " " + this.m_nCreateCount;
        NcEffectBehaviour.SetActiveRecursively(this.m_CreateGameObject, true);
        NcEffectBehaviour.AdjustSpeedRuntime(this.m_CreateGameObject, this.m_fPrefabSpeed);
        if (0f < this.m_fPrefabLifeTime)
        {
            NcAutoDestruct ncAutoDestruct = this.m_CreateGameObject.GetComponent <NcAutoDestruct>();
            if (ncAutoDestruct == null)
            {
                ncAutoDestruct = this.m_CreateGameObject.AddComponent <NcAutoDestruct>();
            }
            ncAutoDestruct.m_fLifeTime = this.m_fPrefabLifeTime;
        }
        if (this.m_bDetachParent)
        {
            NcDetachParent x = this.m_CreateGameObject.GetComponent <NcDetachParent>();
            if (x == null)
            {
                x = this.m_CreateGameObject.AddComponent <NcDetachParent>();
            }
        }
        if ((this.m_fRepeatTime == 0f || this.m_AttachType == NcAttachPrefab.AttachType.Destroy) && 0 < this.m_nRepeatCount && this.m_nCreateCount < this.m_nRepeatCount)
        {
            this.CreateAttachPrefab();
        }
    }