Exemplo n.º 1
0
 protected override void Awake()
 {
     /* Get Components */
     base.Awake();
     pokemon = GetComponentInParent <Pokemon>();
     Eyes    = GetComponent <EyeController>();
 }
Exemplo n.º 2
0
 void Start()
 {
     cam               = Camera.main;
     eyeGO             = GameObject.FindGameObjectWithTag("Player");
     eyeController     = eyeGO.GetComponent <EyeController>();
     reticleController = GameObject.FindGameObjectWithTag("Reticle").GetComponent <ReticleController>();
     IsEyeActive       = false;
 }
Exemplo n.º 3
0
        public Pause(EyeController controller)
        {
            _stateChangedEvent = new PauseStateChangedEvent();
            _stateChangedEvent.StateChanged += StateChanged;

            _controller = controller;

            Enable();
        }
Exemplo n.º 4
0
 private void Awake()
 {
     gameObject.transform.position = new Vector3(0f, -20f, 0f);
     eyeball           = GameObject.FindGameObjectWithTag("Player");
     eyeballController = eyeball.GetComponent <EyeController>();
     GameManager.instance.onPrepLevel   += PrepLevel;
     GameManager.instance.onLoadLevel   += LoadLevel;
     GameManager.instance.onUnloadLevel += UnloadLevel;
 }
Exemplo n.º 5
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        EyeController mEye = (EyeController)target;

        if (GUILayout.Button("Blink"))
        {
            mEye.SetBlinkTrigger();
        }
    }
Exemplo n.º 6
0
        public ImportantItems(EyeController controller)
        {
            _itemAddedEvent = new ImportantItemAddedEvent();
            _itemAddedEvent.ImportantItemAdded += ImportantItemAdded;

            _itemRemovedEvent = new ImportantItemRemovedEvent();
            _itemRemovedEvent.ImportantItemRemoved += ImportantItemRemoved;

            _controller = controller;

            Enable();
        }
Exemplo n.º 7
0
Arquivo: Rune.cs Projeto: orf53975/eye
        public Rune(EyeController controller)
        {
            _modifierAddedEvent = new RuneModifierAddedEvent();
            _modifierAddedEvent.ModifierAdded += ModifierAdded;

            _modifierRemovedEvent = new RuneModifierRemovedEvent();
            _modifierRemovedEvent.ModifierRemoved += ModifierRemoved;

            _controller = controller;

            Enable();
        }
Exemplo n.º 8
0
        public DataShower(EyeController controller)
        {
            _controller = controller;

            Datas = new List <IData>
            {
                new NetworthPercentAndKillsGold(),
                new StacksAndSupportGold(),
                new HeroDamage(),
                new WardsPlaced()
            };

            Enable();
        }
Exemplo n.º 9
0
        public BountyRuneGold(EyeController controller)
        {
            Minutes = new Dictionary <int, BountyRuneGoldMinutes>();

            _pickedup           = new BountyRunePickedupEvent(this);
            _pickedup.PickedUp += OnPickedUp;

            _gameStarted              = new GameStartedEvent();
            _gameStarted.GameStarted += (sender, e) => GameStartedTimeStamp = e;

            _controller = controller;
            _controller.EventManager.Subscribe(_gameStarted);

            Enable();
        }
Exemplo n.º 10
0
    public void Start()
    {
        rigidBody = GetComponent<Rigidbody2D>();
        playerTransform = GameObject.FindGameObjectWithTag("Player").transform;
        playerEuphoriaController = GameObject.FindGameObjectWithTag("Player").GetComponent<EuphoriaController>();
        meleeHitController = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren<MeleeHitController>();
        eyeController = GetComponentInChildren<EyeController>();

        if (eyeController == null) {
            Debug.Log("EyeController");
        }
        if (meleeHitController == null) {
            Debug.Log("MeleeHitController");
        }
        if (eyeController == null) {
            Debug.Log("EyeController");
        }
    }
Exemplo n.º 11
0
    // Update is called once per frame
    void Update()
    {
        float v = OVRInput.Get(OVRInput.Axis1D.PrimaryIndexTrigger, controller);

        SetFingers(1 - v);

        grabbed  = OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger, controller);
        released = OVRInput.GetUp(OVRInput.Button.PrimaryIndexTrigger, controller);

        if (released)
        {
            released = false;

            if (grabbedEye != null)
            {
                grabbedEye.SetAttach(true);
                grabbedEye = null;
            }
        }
    }
Exemplo n.º 12
0
        public AegisTimer(EyeController controller)
        {
            _takenEvent             = new AegisTakenEvent();
            _takenEvent.AegisTaken += OnAegisTaken;

            _onwerSelectedEvent = new AegisOwnerSelectedEvent();;
            _onwerSelectedEvent.AegisOwnerSelected += AegisOwnerSelected;

            _ownerUnselectedEvent = new AegisOwnerUnselectedEvent();
            _ownerUnselectedEvent.AegisOwnerUnselected += AegisOwnerUnselected;

            _ownerSlotChangedEvent = new AegisOwnerSlotChangedEvent();
            _ownerSlotChangedEvent.AegisOwnerSlotChanged += AegisOwnerSlotChanged;

            _controller = controller;

            _controller.EventManager.Subscribe(_onwerSelectedEvent);
            _controller.EventManager.Subscribe(_ownerUnselectedEvent);
            _controller.EventManager.Subscribe(_ownerSlotChangedEvent);
        }
Exemplo n.º 13
0
    public void Start()
    {
        rigidBody                = GetComponent <Rigidbody2D>();
        playerTransform          = GameObject.FindGameObjectWithTag("Player").transform;
        playerEuphoriaController = GameObject.FindGameObjectWithTag("Player").GetComponent <EuphoriaController>();
        meleeHitController       = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <MeleeHitController>();
        eyeController            = GetComponentInChildren <EyeController>();

        if (eyeController == null)
        {
            Debug.Log("EyeController");
        }
        if (meleeHitController == null)
        {
            Debug.Log("MeleeHitController");
        }
        if (eyeController == null)
        {
            Debug.Log("EyeController");
        }
    }
Exemplo n.º 14
0
        public BkbSeconds(EyeController controller)
        {
            _bkbsSeconds = new Dictionary <int, int>();
            for (var i = 0; i < 10; i++)
            {
                _bkbsSeconds.Add(i, 10);
            }

            _usedEvent          = new BkbUsedEvent();
            _usedEvent.BkbUsed += BkbUsed;
            _ownerSelectedEvent = new BkbOwnerSelectedEvent();
            _ownerSelectedEvent.OwnerSelected       += OwnerSelected;
            _ownerUnselectedEvent                    = new BkbOwnerUnselectedEvent();
            _ownerUnselectedEvent.OwnerUnselected   += OwnerUnselected;
            _ownerSlotChangedEvent                   = new BkbOwnerSlotChangedEvent();
            _ownerSlotChangedEvent.OwnerSlotChanged += OwnerSlotChanged;

            _controller = controller;

            Enable();
        }
Exemplo n.º 15
0
    void OnTriggerStay(Collider other)
    {
        Debug.Log(other.name);
        if (grabbed)
        {
            grabbed = false;

            EyeController eye = other.GetComponent <EyeController>();

            if (eye != null)
            {
                // move to new position
                eye.transform.position    = attachPoint.position;
                eye.transform.eulerAngles = attachPoint.eulerAngles;
                eye.transform.parent      = attachPoint.transform;


                grabbedEye = eye;
                eye.SetAttach(false);
            }
        }
    }
    void OnEnable()
    {
        if (!EditorGUIUtility.isProSkin)
        {
            logo = (Texture2D)EditorGUIUtility.Load("Rogo Digital/Eye Controller/Light/EyeController_logo.png");
        }
        else
        {
            logo = (Texture2D)EditorGUIUtility.Load("Rogo Digital/Eye Controller/Dark/EyeController_logo.png");
        }

        myTarget = (EyeController)target;

        blendSystemNumber = BlendSystemEditor.FindBlendSystems(myTarget);

        boneUpdateAnimation = serializedObject.FindProperty("boneUpdateAnimation");

        blinkingEnabled     = serializedObject.FindProperty("blinkingEnabled");
        blinkingControlMode = serializedObject.FindProperty("blinkingControlMode");

        leftEyeBlinkBlendshape  = serializedObject.FindProperty("leftEyeBlinkBlendable");
        rightEyeBlinkBlendshape = serializedObject.FindProperty("rightEyeBlinkBlendable");

        minimumBlinkGap = serializedObject.FindProperty("minimumBlinkGap");
        maximumBlinkGap = serializedObject.FindProperty("maximumBlinkGap");
        blinkDuration   = serializedObject.FindProperty("blinkDuration");

        leftEyeLookAtBone  = serializedObject.FindProperty("_leftEyeLookAtBone");
        rightEyeLookAtBone = serializedObject.FindProperty("_rightEyeLookAtBone");
        eyeRotationRangeX  = serializedObject.FindProperty("eyeRotationRangeX");
        eyeRotationRangeY  = serializedObject.FindProperty("eyeRotationRangeY");

        eyeLookOffset  = serializedObject.FindProperty("eyeLookOffset");
        eyeForwardAxis = serializedObject.FindProperty("eyeForwardAxis");
        eyeTurnSpeed   = serializedObject.FindProperty("eyeTurnSpeed");

        randomLookingEnabled = serializedObject.FindProperty("randomLookingEnabled");
        lookingControlMode   = serializedObject.FindProperty("lookingControlMode");

        minimumChangeDirectionGap = serializedObject.FindProperty("minimumChangeDirectionGap");
        maximumChangeDirectionGap = serializedObject.FindProperty("maximumChangeDirectionGap");

        targetEnabled = serializedObject.FindProperty("targetEnabled");

        viewTarget   = serializedObject.FindProperty("viewTarget");
        targetWeight = serializedObject.FindProperty("targetWeight");

        autoTarget         = serializedObject.FindProperty("autoTarget");
        autoTargetTag      = serializedObject.FindProperty("autoTargetTag");
        autoTargetDistance = serializedObject.FindProperty("autoTargetDistance");

        showBlinking               = new AnimBool(myTarget.blinkingEnabled, Repaint);
        showRandomLook             = new AnimBool(myTarget.randomLookingEnabled, Repaint);
        showLookTarget             = new AnimBool(myTarget.targetEnabled, Repaint);
        showAutoTarget             = new AnimBool(myTarget.autoTarget, Repaint);
        showLookShared             = new AnimBool(myTarget.randomLookingEnabled || myTarget.targetEnabled, Repaint);
        showBlinkingClassicControl = new AnimBool(myTarget.blinkingControlMode == EyeController.ControlMode.Classic, Repaint);
        showLookingClassicControl  = new AnimBool(myTarget.lookingControlMode == EyeController.ControlMode.Classic, Repaint);

        if (myTarget.blendSystem != null)
        {
            if (myTarget.blendSystem.isReady)
            {
                myTarget.blendSystem.onBlendablesChanged += GetBlendShapes;
                GetBlendShapes();
                BlendSystemEditor.GetBlendSystemButtons(myTarget.blendSystem);
            }
        }
    }
Exemplo n.º 17
0
    private void FinishAvatar()
    {
        GameObject          avatar = playerObj.transform.Find("Avatar").gameObject;
        GameObject          head   = avatar.transform.Find("HeadObject").gameObject;
        SkinnedMeshRenderer skinnedMeshRenderer = head.GetComponent <SkinnedMeshRenderer>();

        // Add audio source to player for speaking sound
        AudioSource audioSource = avatar.AddComponent <AudioSource>();

        OVRLipSyncContext ovrContext = avatar.AddComponent <OVRLipSyncContext>();

        ovrContext.audioSource = audioSource;
        ovrContext.audioMute   = false;

        OVRLipSyncContextMorphTarget ovrMorphTarget = avatar.AddComponent <OVRLipSyncContextMorphTarget>();

        ovrMorphTarget.skinnedMeshRenderer = skinnedMeshRenderer;

        ovrMorphTarget.VisemeToBlendTargets[0]  = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("sil");
        ovrMorphTarget.VisemeToBlendTargets[1]  = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("pp");
        ovrMorphTarget.VisemeToBlendTargets[2]  = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("ff");
        ovrMorphTarget.VisemeToBlendTargets[3]  = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("TH");
        ovrMorphTarget.VisemeToBlendTargets[4]  = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("dd");
        ovrMorphTarget.VisemeToBlendTargets[5]  = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("kk");
        ovrMorphTarget.VisemeToBlendTargets[6]  = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("CH");
        ovrMorphTarget.VisemeToBlendTargets[7]  = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("ss");
        ovrMorphTarget.VisemeToBlendTargets[8]  = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("nn");
        ovrMorphTarget.VisemeToBlendTargets[9]  = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("rr");
        ovrMorphTarget.VisemeToBlendTargets[10] = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("AA");
        ovrMorphTarget.VisemeToBlendTargets[11] = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("EE");
        ovrMorphTarget.VisemeToBlendTargets[12] = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("IH");
        ovrMorphTarget.VisemeToBlendTargets[13] = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("OH");
        ovrMorphTarget.VisemeToBlendTargets[14] = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("OU");

        ovrMorphTarget.KeySendVisemeSignal     = new int[15];
        ovrMorphTarget.KeySendVisemeSignal[0]  = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("sil");
        ovrMorphTarget.KeySendVisemeSignal[1]  = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("pp");
        ovrMorphTarget.KeySendVisemeSignal[2]  = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("ff");
        ovrMorphTarget.KeySendVisemeSignal[3]  = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("TH");
        ovrMorphTarget.KeySendVisemeSignal[4]  = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("dd");
        ovrMorphTarget.KeySendVisemeSignal[5]  = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("kk");
        ovrMorphTarget.KeySendVisemeSignal[6]  = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("CH");
        ovrMorphTarget.KeySendVisemeSignal[7]  = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("ss");
        ovrMorphTarget.KeySendVisemeSignal[8]  = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("nn");
        ovrMorphTarget.KeySendVisemeSignal[9]  = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("rr");
        ovrMorphTarget.KeySendVisemeSignal[10] = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("AA");
        ovrMorphTarget.KeySendVisemeSignal[11] = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("EE");
        ovrMorphTarget.KeySendVisemeSignal[12] = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("IH");
        ovrMorphTarget.KeySendVisemeSignal[13] = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("OH");
        ovrMorphTarget.KeySendVisemeSignal[14] = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("OU");

        ovrMorphTarget.SmoothAmount = 10;

        ovrContext.enabled = false;
        ovrContext.enabled = true;

        EyeController eyeController = avatar.AddComponent <EyeController>();

        eyeController.head          = avatar.transform.Find("HeadObject").gameObject;
        eyeController.positiveXAxis = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("EyesRight");
        eyeController.positiveYAxis = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("EyesUp");
        eyeController.negativeXAxis = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("EyesLeft");
        eyeController.negativeYAxis = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("EyesDown");

        eyeController.blinkL = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("EyeBlink_L");
        eyeController.blinkR = skinnedMeshRenderer.sharedMesh.GetBlendShapeIndex("EyeBlink_R");

        // Set camera
        if (cameraObj != null)
        {
            eyeController.target = cameraObj.transform;
            cameraObj.GetComponent <CameraScript>().target = playerObj.transform;
        }

        // send finish command
        AppSocket.SendCommand(AppSocket.SendType.AVATAR_FINISH);
    }