Ejemplo n.º 1
0
    void PlayTaskFinishedAnimation()
    {
        Vector3 pos = transform.parent.parent.GetChild(0).camera.WorldToScreenPoint(m_GetAwardButton.transform.position);

        pos = transform.parent.parent.GetChild(1).camera.ScreenToWorldPoint(pos);

        AssetCacheMgr.GetUIInstance("fx_ui_baoxiangxingxing.prefab", (prefab, id, go) =>
        {
            m_FinishedFX                      = (GameObject)go;
            m_FinishedFX.name                 = m_strOrder;
            m_FinishedFX.transform.parent     = transform.parent.parent.FindChild("DailyTaskFXRoot").transform;
            m_FinishedFX.transform.position   = pos + new Vector3(0, 0, 0);
            m_FinishedFX.transform.localScale = new Vector3(1.5f, 1.5f, 0);
            m_FinishedFX.transform.GetChild(0).gameObject.particleSystem.startSize = 200.0f;
            AutoDie sc          = m_FinishedFX.AddComponent <AutoDie>();
            sc.m_fLifeTime      = 0.0f;
            sc.m_fDisapearIn    = 0.0f;
            sc.m_Target         = m_GetAwardButton;
            sc.m_RelativeCamera = transform.parent.parent.GetChild(1).camera;
        });
    }
Ejemplo n.º 2
0
    void PlayGetAwardFX()
    {
        Vector3 pos = transform.parent.parent.GetChild(0).camera.WorldToScreenPoint(m_GetAwardButton.transform.position);

        pos = transform.parent.parent.GetChild(1).camera.ScreenToWorldPoint(pos);

        AssetCacheMgr.GetUIInstance("fx_ui_icon_open.prefab", (prefab, id, go) =>
        {
            m_GetAwardFX                      = (GameObject)go;
            m_GetAwardFX.name                 = m_strOrder;
            m_GetAwardFX.transform.parent     = m_scDailyTaskFXRoot.transform;
            m_GetAwardFX.transform.position   = pos;
            m_GetAwardFX.transform.localScale = new Vector3(1.5f, 1.5f, 0);
            m_GetAwardFX.transform.GetChild(0).gameObject.particleSystem.startSize = 600.0f;
            m_GetAwardFX.transform.GetChild(1).gameObject.particleSystem.startSize = 600.0f;
            AutoDie sc          = m_GetAwardFX.AddComponent <AutoDie>();
            sc.m_fDisapearIn    = 1.0f;
            sc.m_fLifeTime      = 1.0f;
            sc.m_WhenIDie       = m_scDailyTaskFXRoot.OnFXDie;
            sc.m_Target         = m_GetAwardButton;
            sc.m_RelativeCamera = transform.parent.parent.GetChild(1).camera;
        });
    }