Exemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        IFinishable finishableComponent = eventGO.GetComponent <IFinishable>();

        if (finishableComponent != null)
        {
            finishableComponent.OnExecuted += OnFinish;
        }
    }
 public void AddFinishable(IFinishable finishable)
 {
     if (Done)
     {
         return;
     }
     if (finishable != null)
     {
         finishable.AddToOnFinished(TweenDone);
         ++NumFinishableToWaitFor;
     }
 }
 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;
     }
 }
Exemplo n.º 4
0
 public void Initialize(IFinishable challenge)
 {
     this.challenge = challenge;
 }
 public override void Initialize(IFinishable challenge)
 {
     activityTracker = ActivityTracker.Instance;
     waitingTime     = new WaitForSeconds(time);
     base.Initialize(challenge);
 }