private void Start()
        {
            // Go through all the Reactions and call their Init function.
            for (int i = 0; i < reactions.Length; i++)
            {
                CallbackReaction callbackReaction = reactions[i] as CallbackReaction;

                if (callbackReaction)
                {
                    callbackReaction.Init();
                    continue;
                }

                // The DelayedReaction 'hides' the Reaction's Init function with it's own.
                // This means that we have to try to cast the Reaction to a DelayedReaction and then if it exists call it's Init function.
                // Note that this mainly done to demonstrate hiding and not especially for functionality.
                DelayedReaction delayedReaction = reactions[i] as DelayedReaction;

                if (delayedReaction)
                {
                    delayedReaction.Init();
                    continue;
                }


                reactions[i].Init();
            }
        }
Пример #2
0
 private void Start()
 {
     for (int i = 0; i < reactions.Length; i++)
     {
         DelayedReaction delayedReaction = reactions[i] as DelayedReaction;
         if (delayedReaction != null)
         {
             delayedReaction.Init();
         }
         else
         {
             reactions[i].Init();
         }
     }
 }
Пример #3
0
 public void Init(MonoBehaviour mono)
 {
     for (int i = 0; i < reactions.Length; i++)
     {
         DelayedReaction delayed = reactions[i] as DelayedReaction;
         if (delayed)
         {
             delayed.Init(mono);
         }
         else
         {
             reactions[i].Init();
         }
     }
 }
Пример #4
0
    //Looks through all the reactions and calls their init function
    private void Start()
    {
        for (int i = 0; i < reactions.Length; i++)
        {
            //Delayedreaction => function hiding
            DelayedReaction delayedReaction = reactions[i] as DelayedReaction;

            if (delayedReaction)
            {
                delayedReaction.Init();
            }
            else
            {
                reactions[i].Init();
            }
        }
    }
    // nie bedziemy przechowywac tablic zlozonych z animacji, dzwieku czy tekstu
    // ale prosta tablice reakcji i osiagamy to dzieki polimorfizmowi
    // zakladam ze nie musze tlumaczyc jak dziala dziedziczenie i polimorfizm


    private void Start()  // start function gonna loop through all of the reactions
    // i ona wyzwali ich initialization function
    {
        for (int i = 0; i < reactions.Length; i++)
        {
            DelayedReaction delayedReaction = reactions[i] as DelayedReaction;

            if (delayedReaction)
            {
                delayedReaction.Init();
            }
            else
            {
                reactions[i].Init();
            }
        }
    }
    private void Start()
    {
        audioSourceForTalk = GameObject.Find("EffectSound_For_Click").GetComponent <AudioSource>();
        audioClipForTalk   = Resources.Load <AudioClip>("AudioResource/EffectSound/S_Click");

        for (int i = 0; i < reactions.Length; i++)
        {
            DelayedReaction delayedReaction = reactions[i] as DelayedReaction;

            if (delayedReaction)
            {
                delayedReaction.Init();
            }
            else
            {
                reactions[i].Init();
            }
        }
    }
 // Use this for initialization
 private void Start()
 {
     // Go through all Reactions
     for (int i = 0; i < reactions.Length; i++)
     {
         // (Function Hiding) Cast As Delayed Reaction
         DelayedReaction delayedReaction = reactions[i] as DelayedReaction;
         // If there is a DelayedReaction
         if (delayedReaction)
         {
             // Initialize the DelayedReaction
             delayedReaction.Init();
             // Otherwise:
         }
         else
         {
             // Initialize the Reaction
             reactions[i].Init();
         }
     }
 }
    public void InitIndex()
    {
        startIndex = 0;

        for (int i = 0; i < reactions.Length; i++)
        {
            DelayedReaction delayedReaction = reactions[i] as DelayedReaction;

            if (delayedReaction)
            {
                delayedReaction.Init();
            }
            else
            {
                reactions[i].Init();
            }
        }

        if (FSLocator.textDisplayer != null)
        {
            FSLocator.textDisplayer.reactionButton.onClick.RemoveAllListeners();
        }
    }