Esempio n. 1
0
    // Start is called before the first frame update
    void Start()
    {
        LeftEyeMove  = LeftEye.GetComponent <EyeballMoveV2>();
        RightEyeMove = RightEye.GetComponent <EyeballMoveV2>();

        // Apply inputs // To-Do: move to scriptable object
        LeftEyeMove.SetInputs("Mouse X", "Mouse Y"); //"Left Analog X", "Left Analog Y");
        RightEyeMove.SetInputs("Right Analog X", "Right Analog Y");

        // Set current goals
        LeftEyeMove.SetGoalCoords(CurrentGoal);
        RightEyeMove.SetGoalCoords(CurrentGoal);

        // Randomize Eye Rotation
        LeftEyeMove.Spin(Random.rotation, 2.5f);
        RightEyeMove.Spin(Random.rotation, 2.5f);
    }
Esempio n. 2
0
    // Update is called once per frame
    void Update()
    {
        // Focus the eyes
        ScaleEyeDistance();
        // Move them
        LeftEyeMove.ControlEye();
        RightEyeMove.ControlEye();

        // If we have a goal
        if (CurrentGoal != null)
        {
            // Check if Completed Level
            if (LeftEyeMove.CheckIfCooperating() && RightEyeMove.CheckIfCooperating())
            {
                LeftEyeMove.MoveToFinalGoal();
                RightEyeMove.MoveToFinalGoal();
            }
        }
    }