Exemple #1
0
    public void PlayUnsealChestEffect(Vector3 destGUIPos, EffectEndDelegate endDel)
    {
        StartCoroutine(Create2DPackedEffect(UnsealChestPrefab, destGUIPos,
                                            UnsealChestPrefab.GetCurAnim().GetLength() + 0.2f, endDel));

        Globals.Instance.MSoundManager.PlaySoundEffect("Sounds/UISounds/OpenChest");
    }
Exemple #2
0
    protected override void OnTriggerEnter(Collider other)
    {
        base.OnTriggerEnter(other);

        if (other.gameObject.CompareTag(TagMaskDefine.GFAN_ACTOR))
        {
            DropData tDropData = ItemDataManager.Instance.CopyDropData;
            if (tDropData != null)
            {
                tDropData.PickupItemList.Add(chestID);
            }

            NetSender.Instance.RequestRandomCopyChest(chestID);

            PackedSprite chestAnim = GetComponentInChildren <PackedSprite>() as PackedSprite;
            if (null != chestAnim)
            {
                chestAnim.PlayAnim(1);                 // Unseal a chest animation
                // chestAnim.PlayAnim("OpenBaoxiang");
                float animLen = chestAnim.GetCurAnim().GetLength();

                StartCoroutine(DoWaitForSeconds(animLen + 0.2f, delegate()
                {
                    Status2DCopy status2DCopy = (Status2DCopy)GameStatusManager.Instance.MCopyStatus;
                    if (null != status2DCopy && null != status2DCopy.StageCopy)
                    {
                        status2DCopy.StageCopy.DestroyChest(gameObject);
                    }
                }));
            }
        }
    }
 /// <summary>
 /// Set to star flask texture, but without animating
 /// </summary>
 public void SetLit()
 {
     if (sprite.GetCurAnim().name != "Spin")
     {
         sprite.SetFrame("Spin", 0);
         sprite.PauseAnim();
     }
     else
     {
         sprite.PauseAnim();
     }
 }