Exemple #1
0
 public void BackupUvAnimation(NcUvAnimation uvAniCom)
 {
     if (uvAniCom == null)
     {
         return;
     }
     m_NcUvAnimation  = uvAniCom;
     m_UvAniSaveValue = new Vector2(m_NcUvAnimation.m_fScrollSpeedX, m_NcUvAnimation.m_fScrollSpeedY);
 }
Exemple #2
0
    private void InitAnimation()
    {
        this.m_fElapsedRate           = 0f;
        this.m_Transform              = base.transform;
        this.m_TransformScale         = this.m_Transform.localScale;
        this.m_TransformLocalPosition = this.m_Transform.localPosition;
        this.m_TransformLocalRotation = this.m_Transform.localRotation;
        int count = this.m_CurveInfoList.Count;

        for (int i = 0; i < count; i++)
        {
            NcCurveAnimation.NcInfoCurve ncInfoCurve = this.m_CurveInfoList[i];
            if (ncInfoCurve.m_bEnabled)
            {
                switch (ncInfoCurve.m_ApplyType)
                {
                case NcCurveAnimation.NcInfoCurve.APPLY_TYPE.POSITION:
                    ncInfoCurve.m_OriginalValue = Vector4.zero;
                    ncInfoCurve.m_BeforeValue   = ncInfoCurve.m_OriginalValue;
                    break;

                case NcCurveAnimation.NcInfoCurve.APPLY_TYPE.ROTATION:
                    ncInfoCurve.m_OriginalValue = Vector4.zero;
                    ncInfoCurve.m_BeforeValue   = ncInfoCurve.m_OriginalValue;
                    break;

                case NcCurveAnimation.NcInfoCurve.APPLY_TYPE.SCALE:
                    ncInfoCurve.m_OriginalValue = this.m_Transform.localScale;
                    ncInfoCurve.m_BeforeValue   = ncInfoCurve.m_OriginalValue;
                    break;

                case NcCurveAnimation.NcInfoCurve.APPLY_TYPE.COLOR:
                    if (ncInfoCurve.m_bRecursively)
                    {
                        this.m_ChildRenderers  = base.transform.GetComponentsInChildren <Renderer>(true);
                        this.m_ChildColorNames = new string[this.m_ChildRenderers.Length];
                        ncInfoCurve.m_ChildOriginalColorValues = new Vector4[this.m_ChildRenderers.Length];
                        ncInfoCurve.m_ChildBeforeColorValues   = new Vector4[this.m_ChildRenderers.Length];
                        for (int j = 0; j < this.m_ChildRenderers.Length; j++)
                        {
                            Renderer renderer = this.m_ChildRenderers[j];
                            this.m_ChildColorNames[j] = NcCurveAnimation.Ng_GetMaterialColorName(renderer.material);
                            if (this.m_ChildColorNames[j] != null)
                            {
                                ncInfoCurve.m_ChildOriginalColorValues[j] = renderer.material.GetColor(this.m_ChildColorNames[j]);
                            }
                            ncInfoCurve.m_ChildBeforeColorValues[j] = Vector4.zero;
                        }
                    }
                    else if (this.thisRenderer != null)
                    {
                        this.m_ColorName = NcCurveAnimation.Ng_GetMaterialColorName(this.thisRenderer.sharedMaterial);
                        if (this.m_ColorName != null)
                        {
                            ncInfoCurve.m_OriginalValue = this.thisRenderer.sharedMaterial.GetColor(this.m_ColorName);
                        }
                        ncInfoCurve.m_BeforeValue = Vector4.zero;
                    }
                    break;

                case NcCurveAnimation.NcInfoCurve.APPLY_TYPE.TEXTUREUV:
                    if (this.m_NcUvAnimation == null)
                    {
                        this.m_NcUvAnimation = base.GetComponent <NcUvAnimation>();
                    }
                    if (this.m_NcUvAnimation)
                    {
                        ncInfoCurve.m_OriginalValue = new Vector4(this.m_NcUvAnimation.m_fScrollSpeedX, this.m_NcUvAnimation.m_fScrollSpeedY, 0f, 0f);
                    }
                    ncInfoCurve.m_BeforeValue = ncInfoCurve.m_OriginalValue;
                    break;
                }
            }
        }
    }
    void InitAnimation()
    {
        m_fElapsedRate = 0;
        m_Transform    = transform;
        foreach (NcInfoCurve curveInfo in m_CurveInfoList)
        {
            if (curveInfo.m_bEnabled == false)
            {
                continue;
            }

            switch (curveInfo.m_ApplyType)
            {
            case NcInfoCurve.APPLY_TYPE.NONE: continue;

            case NcInfoCurve.APPLY_TYPE.POSITION:
            {
                curveInfo.m_OriginalValue = Vector4.zero;
                curveInfo.m_BeforeValue   = curveInfo.m_OriginalValue;
                break;
            }

            case NcInfoCurve.APPLY_TYPE.ROTATION:
            {
                curveInfo.m_OriginalValue = Vector4.zero;
                curveInfo.m_BeforeValue   = curveInfo.m_OriginalValue;
                break;
            }

            case NcInfoCurve.APPLY_TYPE.SCALE:
            {
                curveInfo.m_OriginalValue = m_Transform.localScale;
                curveInfo.m_BeforeValue   = curveInfo.m_OriginalValue;
                break;
            }

            case NcInfoCurve.APPLY_TYPE.COLOR:
            {
                if (curveInfo.m_bRecursively)
                {
                    // Recursively
                    m_ChildRenderers  = transform.GetComponentsInChildren <Renderer>(true);
                    m_ChildColorNames = new string[m_ChildRenderers.Length];
                    curveInfo.m_ChildOriginalColorValues = new Vector4[m_ChildRenderers.Length];
                    curveInfo.m_ChildBeforeColorValues   = new Vector4[m_ChildRenderers.Length];

                    for (int n = 0; n < m_ChildRenderers.Length; n++)
                    {
                        Renderer ren = m_ChildRenderers[n];
                        m_ChildColorNames[n] = Ng_GetMaterialColorName(ren.material);

                        if (m_ChildColorNames[n] != null)
                        {
                            curveInfo.m_ChildOriginalColorValues[n] = ren.material.GetColor(m_ChildColorNames[n]);
                        }
                        curveInfo.m_ChildBeforeColorValues[n] = Vector4.zero;
                    }
                }
                else
                {
                    // this Only
                    if (GetComponent <Renderer>() != null)
                    {
                        m_ColorName = Ng_GetMaterialColorName(GetComponent <Renderer>().sharedMaterial);
                        if (m_ColorName != null)
                        {
                            curveInfo.m_OriginalValue = GetComponent <Renderer>().sharedMaterial.GetColor(m_ColorName);
                        }

                        curveInfo.m_BeforeValue = Vector4.zero;
                    }
                }
                break;
            }

            case NcInfoCurve.APPLY_TYPE.TEXTUREUV:
            {
                if (m_NcUvAnimation == null)
                {
                    m_NcUvAnimation = GetComponent <NcUvAnimation>();
                }
                if (m_NcUvAnimation)
                {
                    curveInfo.m_OriginalValue = new Vector4(m_NcUvAnimation.m_fScrollSpeedX, m_NcUvAnimation.m_fScrollSpeedY, 0, 0);
                }
                curveInfo.m_BeforeValue = curveInfo.m_OriginalValue;
                break;
            }
            }
        }
    }
    void InitAnimation()
    {
        if (m_Transform != null)
        {
            return;
        }
        m_fElapsedRate = 0;
        m_Transform    = transform;
        foreach (NcInfoCurve curveInfo in m_CurveInfoList)
        {
            if (curveInfo.m_bEnabled == false)
            {
                continue;
            }

            switch (curveInfo.m_ApplyType)
            {
            case NcInfoCurve.APPLY_TYPE.NONE: continue;

            case NcInfoCurve.APPLY_TYPE.POSITION:
            {
                curveInfo.m_OriginalValue = Vector4.zero;
                curveInfo.m_BeforeValue   = curveInfo.m_OriginalValue;
                break;
            }

            case NcInfoCurve.APPLY_TYPE.ROTATION:
            {
                curveInfo.m_OriginalValue = Vector4.zero;
                curveInfo.m_BeforeValue   = curveInfo.m_OriginalValue;
                break;
            }

            case NcInfoCurve.APPLY_TYPE.SCALE:
            {
                curveInfo.m_OriginalValue = m_Transform.localScale;
                curveInfo.m_BeforeValue   = curveInfo.m_OriginalValue;
                break;
            }

            case NcInfoCurve.APPLY_TYPE.MATERIAL_COLOR:
            {
                if (curveInfo.m_bRecursively)
                {
                    // Recursively
                    if (m_ChildRenderers == null)
                    {
                        m_ChildRenderers  = transform.GetComponentsInChildren <Renderer>(true);
                        m_ChildColorNames = new string[m_ChildRenderers.Length];
                    }
                    curveInfo.m_ChildOriginalColorValues = new Vector4[m_ChildRenderers.Length];
                    curveInfo.m_ChildBeforeColorValues   = new Vector4[m_ChildRenderers.Length];

                    for (int n = 0; n < m_ChildRenderers.Length; n++)
                    {
                        Renderer ren = m_ChildRenderers[n];
                        m_ChildColorNames[n] = Ng_GetMaterialColorName(ren.sharedMaterial);

                        if (m_ChildColorNames[n] != null)
                        {
                            if (m_bSavedOriginalValue == false)
                            {
                                curveInfo.m_ChildOriginalColorValues[n] = ren.material.GetColor(m_ChildColorNames[n]);
//										AddRuntimeMaterial(ren.material);
                            }
                            else
                            {
                                ren.material.SetColor(m_ChildColorNames[n], curveInfo.m_ChildOriginalColorValues[n]);
                            }
                        }
                        curveInfo.m_ChildBeforeColorValues[n] = Vector4.zero;
                    }
                }
                else
                {
                    // this Only
                    if (GetComponent <Renderer>() != null)
                    {
                        m_ColorName = Ng_GetMaterialColorName(GetComponent <Renderer>().sharedMaterial);
                        if (m_ColorName != null)
                        {
                            if (m_bSavedOriginalValue == false)
                            {
                                curveInfo.m_OriginalValue = GetComponent <Renderer>().material.GetColor(m_ColorName);
                            }
                            else
                            {
                                GetComponent <Renderer>().material.SetColor(m_ColorName, curveInfo.m_OriginalValue);
                            }
                        }

                        curveInfo.m_BeforeValue = Vector4.zero;
                    }
                }
                break;
            }

            case NcInfoCurve.APPLY_TYPE.TEXTUREUV:
            {
                if (m_NcUvAnimation == null)
                {
                    m_NcUvAnimation = GetComponent <NcUvAnimation>();
                }
                if (m_NcUvAnimation != null)
                {
                    if (m_bSavedOriginalValue == false)
                    {
                        curveInfo.m_OriginalValue = new Vector4(m_NcUvAnimation.m_fScrollSpeedX, m_NcUvAnimation.m_fScrollSpeedY, 0, 0);
                    }
                    else
                    {
                        m_NcUvAnimation.m_fScrollSpeedX = curveInfo.m_OriginalValue.x;
                        m_NcUvAnimation.m_fScrollSpeedY = curveInfo.m_OriginalValue.y;
                    }
                }
                curveInfo.m_BeforeValue = curveInfo.m_OriginalValue;
                break;
            }

            case NcInfoCurve.APPLY_TYPE.MESH_COLOR:
            {
                float fValue   = curveInfo.m_AniCurve.Evaluate(0);
                Color tarColor = Color.Lerp(curveInfo.m_FromColor, curveInfo.m_ToColor, fValue);
                if (curveInfo.m_bRecursively)
                {
                    // Recursively
                    m_ChildMeshFilters = transform.GetComponentsInChildren <MeshFilter>(true);
                    if (m_ChildMeshFilters == null || m_ChildMeshFilters.Length < 0)
                    {
                        break;
                    }
                    for (int arrayIndex = 0; arrayIndex < m_ChildMeshFilters.Length; arrayIndex++)
                    {
                        ChangeMeshColor(m_ChildMeshFilters[arrayIndex], tarColor);
                    }
                }
                else
                {
                    // this Only
                    m_MainMeshFilter = GetComponent <MeshFilter>();
                    ChangeMeshColor(m_MainMeshFilter, tarColor);
                }
                break;
            }
            }
        }
        m_bSavedOriginalValue = true;
    }
	public void BackupUvAnimation(NcUvAnimation uvAniCom)
	{
		if (uvAniCom == null)
			return;
		m_NcUvAnimation		= uvAniCom;
		m_UvAniSaveValue	= new Vector2(m_NcUvAnimation.m_fScrollSpeedX, m_NcUvAnimation.m_fScrollSpeedY);
	}
Exemple #6
0
	// Property -------------------------------------------------------------------------
	// Event Function -------------------------------------------------------------------
    void OnEnable()
    {
 		m_Sel = target as NcUvAnimation;
 		m_UndoManager	= new FXMakerUndoManager(m_Sel, "NcUvAnimation");
   }
 // Property -------------------------------------------------------------------------
 // Event Function -------------------------------------------------------------------
 void OnEnable()
 {
     m_Sel         = target as NcUvAnimation;
     m_UndoManager = new FXMakerUndoManager(m_Sel, "NcUvAnimation");
 }
    private void InitAnimation()
    {
        if (this.m_Transform != null)
        {
            return;
        }
        this.m_fElapsedRate = 0f;
        this.m_Transform    = base.transform;
        foreach (NcCurveAnimation.NcInfoCurve current in this.m_CurveInfoList)
        {
            if (current.m_bEnabled)
            {
                switch (current.m_ApplyType)
                {
                case NcCurveAnimation.NcInfoCurve.APPLY_TYPE.POSITION:
                    current.m_OriginalValue = Vector4.zero;
                    current.m_BeforeValue   = current.m_OriginalValue;
                    break;

                case NcCurveAnimation.NcInfoCurve.APPLY_TYPE.ROTATION:
                    current.m_OriginalValue = Vector4.zero;
                    current.m_BeforeValue   = current.m_OriginalValue;
                    break;

                case NcCurveAnimation.NcInfoCurve.APPLY_TYPE.SCALE:
                    current.m_OriginalValue = this.m_Transform.localScale;
                    current.m_BeforeValue   = current.m_OriginalValue;
                    break;

                case NcCurveAnimation.NcInfoCurve.APPLY_TYPE.MATERIAL_COLOR:
                    if (current.m_bRecursively)
                    {
                        if (this.m_ChildRenderers == null)
                        {
                            this.m_ChildRenderers  = base.transform.GetComponentsInChildren <Renderer>(true);
                            this.m_ChildColorNames = new string[this.m_ChildRenderers.Length];
                        }
                        current.m_ChildOriginalColorValues = new Vector4[this.m_ChildRenderers.Length];
                        current.m_ChildBeforeColorValues   = new Vector4[this.m_ChildRenderers.Length];
                        for (int i = 0; i < this.m_ChildRenderers.Length; i++)
                        {
                            Renderer renderer = this.m_ChildRenderers[i];
                            this.m_ChildColorNames[i] = NcCurveAnimation.Ng_GetMaterialColorName(renderer.sharedMaterial);
                            if (this.m_ChildColorNames[i] != null)
                            {
                                if (!this.m_bSavedOriginalValue)
                                {
                                    current.m_ChildOriginalColorValues[i] = renderer.material.GetColor(this.m_ChildColorNames[i]);
                                }
                                else
                                {
                                    renderer.material.SetColor(this.m_ChildColorNames[i], current.m_ChildOriginalColorValues[i]);
                                }
                            }
                            current.m_ChildBeforeColorValues[i] = Vector4.zero;
                        }
                    }
                    else if (base.renderer != null)
                    {
                        this.m_ColorName = NcCurveAnimation.Ng_GetMaterialColorName(base.renderer.sharedMaterial);
                        if (this.m_ColorName != null)
                        {
                            if (!this.m_bSavedOriginalValue)
                            {
                                current.m_OriginalValue = base.renderer.material.GetColor(this.m_ColorName);
                            }
                            else
                            {
                                base.renderer.material.SetColor(this.m_ColorName, current.m_OriginalValue);
                            }
                        }
                        current.m_BeforeValue = Vector4.zero;
                    }
                    break;

                case NcCurveAnimation.NcInfoCurve.APPLY_TYPE.TEXTUREUV:
                    if (this.m_NcUvAnimation == null)
                    {
                        this.m_NcUvAnimation = base.GetComponent <NcUvAnimation>();
                    }
                    if (this.m_NcUvAnimation != null)
                    {
                        if (!this.m_bSavedOriginalValue)
                        {
                            current.m_OriginalValue = new Vector4(this.m_NcUvAnimation.m_fScrollSpeedX, this.m_NcUvAnimation.m_fScrollSpeedY, 0f, 0f);
                        }
                        else
                        {
                            this.m_NcUvAnimation.m_fScrollSpeedX = current.m_OriginalValue.x;
                            this.m_NcUvAnimation.m_fScrollSpeedY = current.m_OriginalValue.y;
                        }
                    }
                    current.m_BeforeValue = current.m_OriginalValue;
                    break;

                case NcCurveAnimation.NcInfoCurve.APPLY_TYPE.MESH_COLOR:
                {
                    float t        = current.m_AniCurve.Evaluate(0f);
                    Color tarColor = Color.Lerp(current.m_FromColor, current.m_ToColor, t);
                    if (current.m_bRecursively)
                    {
                        this.m_ChildMeshFilters = base.transform.GetComponentsInChildren <MeshFilter>(true);
                        if (this.m_ChildMeshFilters != null && this.m_ChildMeshFilters.Length >= 0)
                        {
                            for (int j = 0; j < this.m_ChildMeshFilters.Length; j++)
                            {
                                this.ChangeMeshColor(this.m_ChildMeshFilters[j], tarColor);
                            }
                        }
                    }
                    else
                    {
                        this.m_MainMeshFilter = base.GetComponent <MeshFilter>();
                        this.ChangeMeshColor(this.m_MainMeshFilter, tarColor);
                    }
                    break;
                }
                }
            }
        }
        this.m_bSavedOriginalValue = true;
    }
    /*
     * /// <summary>
     * /// 코인이 점핑 애니메이션을 하게 한다.
     * /// </summary>
     * IEnumerator JumpingAnimEffect(Transform coinTrans)
     * {
     *  float JumpVelY = JumpingHeight;
     *  float GravityY = (JumpVelY * 2f) / JumpingDuration;
     *  float jumpTime = 0f;
     *  float delta;
     *
     *  Vector3 destPos = coinTrans.position;
     *  Vector3 pos = coinTrans.position;
     *
     *  while (jumpTime <= JumpingDuration)
     *  {
     *      pos = coinTrans.position;
     *
     *      delta = Time.deltaTime;
     *
     *      pos.y       += JumpVelY * delta;
     *      JumpVelY    -= GravityY * delta;
     *      jumpTime    += delta;
     *
     *      coinTrans.position = pos;
     *
     *      yield return null;
     *  }
     *
     *  coinTrans.position = destPos;
     * }
     */
    /// 코인 섭취시 대상으로 이동시키는 애니메이션.
    IEnumerator EatAnimEffect(Transform coinTrans, Transform target, float duration, float delay)
    {
        //yield return StartCoroutine( MoveToPosition(coinTrans, (Quaternion.AngleAxis( Random.Range(0, 360), Vector3.up ) * coinTrans.forward)+ coinTrans.position, delay - 0.33f) );
        if (CoinEff == null)
        {
            InitTweenAsset();
        }

        CoinEff.SetActive(true);
        SkinnedMeshRenderer meshRender = coinTrans.FindChild("coin024").GetComponent <SkinnedMeshRenderer>();
        Color color = meshRender.material.GetColor("_AddColor");

        color.a = 1f;
        meshRender.material.SetColor("_AddColor", color);

        for (int i = 0; i < CoinEff.transform.childCount; i++)
        {
            Transform tf = CoinEff.transform.GetChild(i);
            for (int j = 0; j < tf.childCount; j++)
            {
                NcUvAnimation    ncUv    = tf.GetChild(j).GetComponent <NcUvAnimation>();
                NcCurveAnimation ncCurve = tf.GetChild(j).GetComponent <NcCurveAnimation>();
                if (ncUv == null)
                {
                    continue;
                }

                ncCurve.enabled = true;
                ncUv.enabled    = true;
            }

            NcUvAnimation    _ncUv    = tf.GetComponent <NcUvAnimation>();
            NcCurveAnimation _ncCurve = tf.GetComponent <NcCurveAnimation>();
            if (_ncUv == null)
            {
                continue;
            }

            _ncCurve.enabled = true;
            _ncUv.enabled    = true;
        }

        for (int i = 0; i < Materials.Count; i++)
        {
            Color c = Materials[i].GetColor("_TintColor");
            c.a = MaterialAlphas[i];
            Materials[i].SetColor("_TintColor", c);
        }

        EventListner.instance.TriggerEvent("COIN_LOOTING", gold);
        //for(int i=0; i < CoinEffs.Length; i++)
        //{
        //    Renderer render = CoinEffs[i].renderer;
        //    Color partiC = render.material.GetColor("_TintColor");
        //    partiC.a = EffOriAlpha;
        //    render.material.SetColor("_TintColor", partiC);
        //}

        yield return(new WaitForSeconds(delay + 0.4f));

        animation.Play("coin_stop");
        //< UI위치로 변경
        //coinTrans.parent = UIMgr.instance.UICamera.camera.transform;
        //Vector3 spawnedPos = MathHelper.WorldToUIPosition(coinTrans.position);
        //coinTrans.transform.localPosition = new Vector3(spawnedPos.x, spawnedPos.y, -270);
        //coinTrans.transform.localScale = new Vector3(90, 90, 1);
        //coinTrans.transform.localRotation = Quaternion.identity;
        //NGUITools.SetLayer(coinTrans.gameObject, 8);

        /*
         * //coinTrans.position = Vector3.zero;
         * Vector3 upPos = new Vector3(0, 1f, 0);
         * //< 현재 위치에서부터 목표 위치까지 이동시킨다.
         * //Vector3 f3 = target.position - coinTrans.position;
         * float moveSpeed = 0;
         * while (true)
         * {
         *  Vector3 targetPos = target.position;
         *  targetPos.y += 1f;
         *  moveSpeed += 2f * Time.fixedDeltaTime;
         *  //if (10f < moveSpeed)
         *  //    moveSpeed = 10f;
         *
         *  int count = coinTrans.childCount-1;
         *  for (int i=0; i < coinTrans.childCount; i++)
         *  {
         *      if (!coinTrans.GetChild(i).name.Contains("aniBone"))
         *          continue;
         *      else if (Vector3.Distance(coinTrans.GetChild(i).position, targetPos) < 1f)
         *      {
         *          coinTrans.GetChild(i).GetComponent<TweenPosition>().enabled = false;
         *          --count;
         *          continue;
         *      }
         *
         *      TweenPosition tweenPos = coinTrans.GetChild(i).GetComponent<TweenPosition>();
         *      if (!tweenPos.enabled)
         *      {
         *          tweenPos.to = target.position;
         *          tweenPos.from = coinTrans.GetChild(i).position;
         *          tweenPos.ResetToBeginning();
         *          tweenPos.PlayForward();
         *      }
         *      //Vector3 offset = targetPos - coinTrans.GetChild(i).position;
         *      //coinTrans.GetChild(i).position += (offset.normalized * (moveSpeed*Time.fixedDeltaTime) );
         *  }
         *
         *  if (count <= 0)
         *      break;
         *
         *  //< 프레임을 좀더 딜레이 걸어준다.
         *  yield return null;
         * }
         */

        for (int i = 0; i < CoinEff.transform.childCount; i++)
        {
            Transform tf = CoinEff.transform.GetChild(i);
            for (int j = 0; j < tf.childCount; j++)
            {
                NcUvAnimation    ncUv    = tf.GetChild(j).GetComponent <NcUvAnimation>();
                NcCurveAnimation ncCurve = tf.GetChild(j).GetComponent <NcCurveAnimation>();
                if (ncUv == null)
                {
                    continue;
                }

                ncCurve.enabled = false;
                ncUv.enabled    = false;
            }

            NcUvAnimation    _ncUv    = tf.GetComponent <NcUvAnimation>();
            NcCurveAnimation _ncCurve = tf.GetComponent <NcCurveAnimation>();
            if (_ncUv == null)
            {
                continue;
            }

            _ncCurve.enabled = false;
            _ncUv.enabled    = false;
        }

        float alpha = 1f;//, alpha2 = EffOriAlpha;

        while (0 < alpha)
        {
            alpha -= (2f * Time.deltaTime);
            //alpha2 -= (1f * Time.deltaTime);

            Color c = meshRender.material.GetColor("_AddColor");
            c.a = alpha;
            meshRender.material.SetColor("_AddColor", c);

            for (int i = 0; i < MaterialAlphas.Count; i++)
            {
                //if (MaterialAlphas[i] < alpha)
                //    continue;

                Color partiC = Materials[i].GetColor("_TintColor");
                if (partiC.a <= 0)
                {
                    continue;
                }

                partiC.a -= 2f * Time.deltaTime;//alpha;
                Materials[i].SetColor("_TintColor", partiC);
            }

            yield return(null);
        }

        //EventListner.instance.TriggerEvent("COIN_LOOTING", gold);

        yield return(new WaitForEndOfFrame());

        //NGUITools.SetLayer(coinTrans.gameObject, 0);
        if (PoolManager.Pools.ContainsKey("InGameObj"))
        {
            PoolManager.Pools["InGameObj"].Despawn(transform);
        }
    }
Exemple #10
0
    public void play()
    {
        for (int i = 0; i < eod.particleSystemList.Count; i++)
        {
            ParticleSystem ps = eod.particleSystemList[i];
            if (ps != null)
            {
                ps.Play(true);
            }
        }
        //foreach (SpriteAnimation sa in spriteAnimationList)
        //{
        //    sa.delayIng = true;
        //    sa.loop = false;
        //    sa.enabled = true;
        //    sa.isPaused = false;
        //}
        float time = 5000f - (Time.time - oldTime);

        for (int i = 0; i < eod.ncCurveAnimationList.Count; i++)
        {
            NcCurveAnimation nc = eod.ncCurveAnimationList[i];
            if (nc.isDelay())
            {
                nc.m_fDelayTime -= time;
            }
            else
            {
                nc.ResumeAnimation();
            }
        }
        for (int i = 0; i < eod.ncSpriteAnimationList.Count; i++)
        {
            NcSpriteAnimation nc = eod.ncSpriteAnimationList[i];
            if (nc.isDelay())
            {
                nc.m_fDelayTime -= time;
            }
            else
            {
                nc.ResumeAnimation();
            }
        }
        for (int i = 0; i < eod.ncUvAnimationList.Count; i++)
        {
            NcUvAnimation nc = eod.ncUvAnimationList[i];
            nc.ResumeAnimation();
        }
        for (int i = 0; i < eod.ncRotationList.Count; i++)
        {
            NcRotation nc = eod.ncRotationList[i];
            nc.ResumeAnimation();
        }
        for (int i = 0; i < eod.animatorList.Count; i++)
        {
            Animator animator = eod.animatorList[i];
            animator.speed = 1;
        }
        for (int i = 0; i < eod.animationList.Count; i++)
        {
            Animation animation = eod.animationList[i];
            animation.Play();
        }
    }
Exemple #11
0
 public void stop()
 {
     for (int i = 0; i < eod.particleSystemList.Count; i++)
     {
         ParticleSystem ps = eod.particleSystemList[i];
         if (ps != null)
         {
             ps.Pause(true);
         }
     }
     //foreach (SpriteAnimation sa in eod.spriteAnimationList)
     //{
     //    sa.delayIng = true;
     //    sa.loop = false;
     //    sa.enabled = true;
     //    sa.isPaused = true;
     //}
     oldTime = Time.time;
     for (int i = 0; i < eod.ncCurveAnimationList.Count; i++)
     {
         NcCurveAnimation nc = eod.ncCurveAnimationList[i];
         if (nc.isDelay())
         {
             nc.m_fDelayTime += 5000f;
         }
         else
         {
             nc.PauseAnimation();
         }
     }
     for (int i = 0; i < eod.ncSpriteAnimationList.Count; i++)
     {
         NcSpriteAnimation nc = eod.ncSpriteAnimationList[i];
         if (nc.isDelay())
         {
             nc.m_fDelayTime += 5000f;
         }
         else
         {
             nc.PauseAnimation();
         }
     }
     for (int i = 0; i < eod.ncUvAnimationList.Count; i++)
     {
         NcUvAnimation nc = eod.ncUvAnimationList[i];
         nc.PauseAnimation();
     }
     for (int i = 0; i < eod.ncRotationList.Count; i++)
     {
         NcRotation nc = eod.ncRotationList[i];
         nc.PauseAnimation();
     }
     for (int i = 0; i < eod.animatorList.Count; i++)
     {
         Animator animator = eod.animatorList[i];
         animator.speed = 0;
     }
     for (int i = 0; i < eod.animationList.Count; i++)
     {
         Animation animation = eod.animationList[i];
         animation.Stop();
     }
 }
    private void InitAnimation()
    {
        this.m_fElapsedRate = 0f;
        this.m_Transform    = base.get_transform();
        using (List <NcCurveAnimation.NcInfoCurve> .Enumerator enumerator = this.m_CurveInfoList.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                NcCurveAnimation.NcInfoCurve current = enumerator.get_Current();
                if (current.m_bEnabled)
                {
                    switch (current.m_ApplyType)
                    {
                    case NcCurveAnimation.NcInfoCurve.APPLY_TYPE.POSITION:
                        current.m_OriginalValue = Vector4.get_zero();
                        current.m_BeforeValue   = current.m_OriginalValue;
                        break;

                    case NcCurveAnimation.NcInfoCurve.APPLY_TYPE.ROTATION:
                        current.m_OriginalValue = Vector4.get_zero();
                        current.m_BeforeValue   = current.m_OriginalValue;
                        break;

                    case NcCurveAnimation.NcInfoCurve.APPLY_TYPE.SCALE:
                        current.m_OriginalValue = this.m_Transform.get_localScale();
                        current.m_BeforeValue   = current.m_OriginalValue;
                        break;

                    case NcCurveAnimation.NcInfoCurve.APPLY_TYPE.COLOR:
                        if (current.m_bRecursively)
                        {
                            this.m_ChildRenderers              = base.get_transform().GetComponentsInChildren <Renderer>(true);
                            this.m_ChildColorNames             = new string[this.m_ChildRenderers.Length];
                            current.m_ChildOriginalColorValues = new Vector4[this.m_ChildRenderers.Length];
                            current.m_ChildBeforeColorValues   = new Vector4[this.m_ChildRenderers.Length];
                            for (int i = 0; i < this.m_ChildRenderers.Length; i++)
                            {
                                Renderer renderer = this.m_ChildRenderers[i];
                                this.m_ChildColorNames[i] = NcCurveAnimation.Ng_GetMaterialColorName(renderer.get_material());
                                if (this.m_ChildColorNames[i] != null)
                                {
                                    current.m_ChildOriginalColorValues[i] = renderer.get_material().GetColor(this.m_ChildColorNames[i]);
                                }
                                current.m_ChildBeforeColorValues[i] = Vector4.get_zero();
                            }
                        }
                        else if (base.GetComponent <Renderer>() != null)
                        {
                            this.m_ColorName = NcCurveAnimation.Ng_GetMaterialColorName(base.GetComponent <Renderer>().get_sharedMaterial());
                            if (this.m_ColorName != null)
                            {
                                current.m_OriginalValue = base.GetComponent <Renderer>().get_sharedMaterial().GetColor(this.m_ColorName);
                            }
                            current.m_BeforeValue = Vector4.get_zero();
                        }
                        break;

                    case NcCurveAnimation.NcInfoCurve.APPLY_TYPE.TEXTUREUV:
                        if (this.m_NcUvAnimation == null)
                        {
                            this.m_NcUvAnimation = base.GetComponent <NcUvAnimation>();
                        }
                        if (this.m_NcUvAnimation)
                        {
                            current.m_OriginalValue = new Vector4(this.m_NcUvAnimation.m_fScrollSpeedX, this.m_NcUvAnimation.m_fScrollSpeedY, 0f, 0f);
                        }
                        current.m_BeforeValue = current.m_OriginalValue;
                        break;
                    }
                }
            }
        }
    }
Exemple #13
0
    private void InitAnimation()
    {
        this.m_fElapsedRate = 0f;
        this.m_Transform    = base.transform;
        foreach (NcInfoCurve curve in this.m_CurveInfoList)
        {
            Color color;
            int   num3;
            if (curve.m_bEnabled)
            {
                switch (curve.m_ApplyType)
                {
                case NcInfoCurve.APPLY_TYPE.POSITION:
                    curve.m_OriginalValue = Vector4.zero;
                    curve.m_BeforeValue   = curve.m_OriginalValue;
                    break;

                case NcInfoCurve.APPLY_TYPE.ROTATION:
                    curve.m_OriginalValue = Vector4.zero;
                    curve.m_BeforeValue   = curve.m_OriginalValue;
                    break;

                case NcInfoCurve.APPLY_TYPE.SCALE:
                    curve.m_OriginalValue = this.m_Transform.localScale;
                    curve.m_BeforeValue   = curve.m_OriginalValue;
                    break;

                case NcInfoCurve.APPLY_TYPE.MATERIAL_COLOR:
                    if (!curve.m_bRecursively)
                    {
                        goto Label_01B0;
                    }
                    this.m_ChildRenderers            = base.transform.GetComponentsInChildren <Renderer>(true);
                    this.m_ChildColorNames           = new string[this.m_ChildRenderers.Length];
                    curve.m_ChildOriginalColorValues = new Vector4[this.m_ChildRenderers.Length];
                    curve.m_ChildBeforeColorValues   = new Vector4[this.m_ChildRenderers.Length];
                    for (int i = 0; i < this.m_ChildRenderers.Length; i++)
                    {
                        Renderer renderer = this.m_ChildRenderers[i];
                        this.m_ChildColorNames[i] = Ng_GetMaterialColorName(renderer.sharedMaterial);
                        if (this.m_ChildColorNames[i] != null)
                        {
                            curve.m_ChildOriginalColorValues[i] = (Vector4)renderer.material.GetColor(this.m_ChildColorNames[i]);
                        }
                        curve.m_ChildBeforeColorValues[i] = Vector4.zero;
                    }
                    break;

                case NcInfoCurve.APPLY_TYPE.TEXTUREUV:
                    if (this.m_NcUvAnimation == null)
                    {
                        this.m_NcUvAnimation = base.GetComponent <NcUvAnimation>();
                    }
                    if (this.m_NcUvAnimation != null)
                    {
                        curve.m_OriginalValue = new Vector4(this.m_NcUvAnimation.m_fScrollSpeedX, this.m_NcUvAnimation.m_fScrollSpeedY, 0f, 0f);
                    }
                    curve.m_BeforeValue = curve.m_OriginalValue;
                    break;

                case NcInfoCurve.APPLY_TYPE.MESH_COLOR:
                {
                    float t = curve.m_AniCurve.Evaluate(0f);
                    color = Color.Lerp(curve.m_FromColor, curve.m_ToColor, t);
                    if (!curve.m_bRecursively)
                    {
                        goto Label_031B;
                    }
                    this.m_ChildMeshFilters = base.transform.GetComponentsInChildren <MeshFilter>(true);
                    if ((this.m_ChildMeshFilters != null) && (this.m_ChildMeshFilters.Length >= 0))
                    {
                        goto Label_02E8;
                    }
                    break;
                }
                }
            }
            continue;
Label_01B0:
            if (base.GetRenderer() != null)
            {
                this.m_ColorName = Ng_GetMaterialColorName(base.GetRenderer().sharedMaterial);
                if (this.m_ColorName != null)
                {
                    curve.m_OriginalValue = (Vector4)base.GetRenderer().sharedMaterial.GetColor(this.m_ColorName);
                }
                curve.m_BeforeValue = Vector4.zero;
            }
            continue;
Label_02E8:
            num3 = 0;
            while (num3 < this.m_ChildMeshFilters.Length)
            {
                this.ChangeMeshColor(this.m_ChildMeshFilters[num3], color);
                num3++;
            }
            continue;
Label_031B:
            this.m_MainMeshFilter = base.GetComponent <MeshFilter>();
            this.ChangeMeshColor(this.m_MainMeshFilter, color);
        }
    }