Exemplo n.º 1
0
 private void SetWaitingTime()
 {
     if (updateMode == UpdateMode.UnscaledTime)
     {
         waitTillActivationUnscaled = new WaitForSecondsCustomRealtime(timeTillActivation);
     }
     else
     {
         waitTillActivationScaled = new WaitForSeconds(timeTillActivation);
     }
 }
        private void Initialize()
        {
            if (timeMode == TimeMode.Unscaled)
            {
                waitTillActivationUnscaled = new WaitForSecondsCustomRealtime(timeTillActivation);
            }
            else
            {
                waitTillActivationScaled = new WaitForSeconds(timeTillActivation);
            }

            initialized = true;
        }
 public virtual void Initialize(IFinishable challenge)
 {
     this.challenge         = challenge;
     waitForSecondsRealtime = new WaitForSecondsCustomRealtime(deactivationDelayAfterFinish);
     subChallenges          = new IChallengeController[positions.Length];
     for (int i = 0; i < positions.Length; i++)
     {
         var position     = positions[i];
         var go           = Instantiate(prefab, position.localPosition, position.localRotation, transform);
         var subChallenge = go.GetComponent <IChallengeController>();
         subChallenge.Initialize(this);
         go.SetActive(false);
         subChallenges[i] = subChallenge;
     }
 }