Exemple #1
0
        /// <Summary>
        /// Treasure box opening process.
        /// </Summary>
        /// <param name="treasureObj">The treasure box object to animate.</param>
        /// <param name="eventParts">The event parts data.</param>
        IEnumerator TreasureAnimation(GameObject treasureObj, AriadneEventParts eventParts)
        {
            // Get the TreasureAnimator component.
            TreasureAnimator treasureAnim = treasureObj.GetComponent <TreasureAnimator>();

            if (treasureAnim != null)
            {
                // Send treasure open message.
                treasureAnim.OpenTreasureBox();

                // Wait until the treasure box is opened.
                yield return(new WaitForSeconds(treasureAnimTime));

                // Show item message.
                SetTreasureItem(eventParts);
            }
            else
            {
                AnimatorWarning(treasureObj);
            }
        }