Пример #1
0
        void Troll()
        {
            ClockAnimator clock = clocks[random].GetComponent <ClockAnimator>(); //Sameklē pūlksteni pie kura stāv izmantojot waypoint indexu

            clock.setRandomTroll();                                              // izsauc ClockAnimator metodi, kas uzstāda random ciparu, ko izmanto lai pārmainītu laiku uz nepareizu

            random = UnityEngine.Random.Range(0, waypoints.Length);              //izvēlas jaunu waypoint
            state  = basicAI.State.WONDERING;                                    //maina state uz wondering
        }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        theEngineChapel = GameObject.Find ("Dialogue Engine Chapel Object");
        externalScriptChapel = theEngineChapel.GetComponent<dialogueEngineChapel>();
        isColliding = false;
        sceneStarted = false;
        activeTrigger = true;

        clockObj = GameObject.Find ("Clock");
        clockScript = clockObj.GetComponent<ClockAnimator>();
    }
Пример #3
0
    void Cast()
    {
        RaycastHit hit;                                                                     // Izveido mainīgo kas satur informāciju par objektu, kuram trāpija Raycast

        if (Physics.Raycast(cam.transform.position, cam.transform.forward, out hit, range)) // ja Raycast trāpa  range attālumā
        {
            ClockAnimator target = hit.transform.GetComponent <ClockAnimator>();            //izveido ClockAnimator, kuram piesaista trāpītā objekta parametrus
            if (target != null)                                                             //ja ir target
            {
                target.resetTime();                                                         // izsauc ClockAnimator metodi resetTime(), kas izlabo laiku
            }
        }
    }
Пример #4
0
    // Start is called before the first frame update
    void Start()
    {
        cam = GetComponent <Camera>();
        timeLookingAtCurrentObject = 0f;
        startingYRotation          = gameObject.transform.rotation.y;

        animator = clock.GetComponent <ClockAnimator>();
        animator.AnimationEnded += OnAnimationEnded;

        recognizer = new GestureRecognizer();
        recognizer.SetRecognizableGestures(GestureSettings.Tap | GestureSettings.Hold);
        recognizer.Tapped        += OnGestureTapped;
        recognizer.HoldStarted   += OnGestureHoldStart;
        recognizer.HoldCompleted += OnGestureHoldComplete;
        recognizer.HoldCanceled  += OnGestureHoldCanceled;
        recognizer.StartCapturingGestures();
    }