Esempio n. 1
0
    public ActivityCallbacks Start(ILevelSection section)
    {
        if (_started)
        {
            throw new InvalidOperationException("Already started");
        }

        Analytics.CustomEvent(CustomEventNames.StartActivity, new Dictionary <string, object> {
            { CustomEventData.ActivityType, GetType().Name }, { CustomEventData.ActivityDifficulty, Difficulty }
        });

        _started = true;
        _root    = new GameObject(GetType().Name);

        Section = section;
        Section.EndSection.OnPlayerLeftActivity      = PlayerLeftActivity;
        Section.EndSection.OnPlayerResumedActivity   = ReturnedToActivity;
        Section.EndSection.OnPlayerEnteredEvaluation = ActivityEvaluationTriggered;

        Ressi = LocateRessiController();

        BuildActivity(section, _root);

        _lapTimeStart = Time.time;

        Debug.Log("ACTIVITY ::: Player started activity");

        return(_callbacks);
    }
 public EndActivityTransition(GameObject root, EvaluationManager manager)
 {
     _manager          = manager;
     _root             = root;
     _transition       = manager.ActivityTransition;
     _eventTrigger     = root.GetComponent <ActivityTransitionFinished>();
     _evaluationLights = _transition.GetComponentsInChildren <EvaluationLight>();
     _ressi            = GameObject.FindObjectOfType <RessiController>();
 }
    public DrawingActivityInstance(RessiController ressi, GameObject parent, int activityIndex, float position)
    {
        Position = new Vector2(position, 0);
        _ressi   = ressi;

        _root = new GameObject("Drawing Activity " + activityIndex);
        _root.transform.parent = parent.transform;

        _canvasTrigger         = CreateTrigger(position, _root);
        _canvasTrigger.OnEnter = RessiReachedTrigger;
    }
 public RessiCommunication(RessiController ressi)
 {
     _ressi         = ressi;
     _ressiRenderer = _ressi.GetComponent <Renderer>();
 }