Ejemplo n.º 1
0
    private void Update( )
    {
        Vector3 fwd = PlayerCurriculum.instance.GetRightHand().transform.forward;
        Vector3 pos = PlayerCurriculum.instance.GetRightHand().transform.position + fwd;

        pointer.transform.position = pos + 10.0f * fwd;

        // SetVolume ( 1.0f );
        if (PlayerCurriculum.instance.GetLeftTriggerDown( ))
        {
            if (debug)
            {
                Debug.Log("leftHand.Trigger > 0.5f");
            }
            RaycastHit hit = new RaycastHit();
            Ray        ray = new Ray(pos, fwd);
            if (Physics.Raycast(ray, out hit, 50.0f))
            {
                if (debug)
                {
                    Debug.Log("Raycast: " + hit.transform.gameObject.name);
                }
                MixerFeature_m mixerFeature = hit.transform.gameObject.GetComponent <MixerFeature_m>();
                if (mixerFeature != null)
                {
                    if (debug)
                    {
                        Debug.Log("mixerFeature.Fill to: " + hit.point.y / hit.collider.transform.localScale.y);
                    }
                    mixerFeature.FillTo(hit.point.y / hit.collider.transform.localScale.y);
                    pointer.transform.position = hit.point;
                }
            }
        }

        if (PlayerCurriculum.instance.GetRightTriggerDown( ))
        {
            if (debug)
            {
                Debug.Log("rightHand.Trigger > 0.5f");
            }
            RaycastHit hit = new RaycastHit();
            Ray        ray = new Ray(pos, fwd);
            if (Physics.Raycast(ray, out hit, 50.0f))
            {
                if (debug)
                {
                    Debug.Log("Raycast: " + hit.transform.gameObject.name);
                }
                MixerFeature_m mixerFeature = hit.transform.gameObject.GetComponent <MixerFeature_m>();
                if (mixerFeature != null)
                {
                    if (debug)
                    {
                        Debug.Log("mixerFeature.Fill to: " + hit.point.y / hit.collider.transform.localScale.y);
                    }
                    mixerFeature.FillTo(hit.point.y / hit.collider.transform.localScale.y);
                    pointer.transform.position = hit.point;
                }
            }
        }
    }
Ejemplo n.º 2
0
 public void AddMe(MixerFeature_m mixerFeature)
 {
     mixerFeatures.Add(mixerFeature);
 }