private void NewMiniature()
        {
            currentMiniature = Instantiate(Prefab, transform.position, transform.rotation, transform);
            miniatureInPlace = true;

            currentMiniInteractable = currentMiniature.GetComponent <VRTK_InteractableObject>();
            currentMiniInteractable.InteractableObjectUngrabbed += OnMiniatureUnGrabbed;
        }
Beispiel #2
0
        void Awake()
        {
            output = GetComponentInChildren <PhysicalDataOutput>();

            shellTrigger = transform.Find("Shell").GetComponent <SimpleTrigger>();
            shellTrigger.TriggerEnter += OnShellTriggerEnter;
            shellTrigger.TriggerExit  += OnShellTriggerExit;

            Material shellMat = shellTrigger.transform.GetComponent <MeshRenderer>().material;

            baseShellEmissionGain = shellMat.GetFloat("_EmissionGain");
            baseShellColor        = shellMat.GetColor("_TintColor");

            foreignCores = new Dictionary <NoteOrb, List <NoteCore> >();

            coreContainer           = transform.Find("Cores");
            coreContainerLowerBound = coreContainer.Find("LowerBound");

            NoteCore initialCore = coreContainer.Find("InitialCore").GetComponent <NoteCore>();

            initialCoreScale = initialCore.transform.localScale;
            fullCoreScale    = new Vector3(FULL_ORB_CORE_RADIUS, FULL_ORB_CORE_RADIUS, FULL_ORB_CORE_RADIUS);

            noteCores = new List <NoteCore>();
            noteCores.Add(initialCore);

            collidingBatons = new HashSet <Baton>();

            selectedNotes = new List <int>();

            interactable = GetComponent <VRTK_InteractableObject>();
            interactable.InteractableObjectGrabbed   += OnGrabbed;
            interactable.InteractableObjectUngrabbed += OnUngrabbed;

            miniature = GetComponent <Miniature>();

            HMD = GameObject.FindGameObjectWithTag("Headset").transform;

            noteSelector            = FindObjectOfType <NoteSelector>();
            defaultSelfDestructArgs = new EventArgs();

            previewTriggerEventArgs          = new TriggerEventArgs();
            previewTriggerEventArgs.Velocity = 95;

            GetComponent <Triggerable>().TriggerStarted += OrbOn;
            GetComponent <Triggerable>().TriggerEnded   += OrbOff;
        }
 public MiniatureEventArgs(Miniature miniature)
 {
     Miniature = miniature;
 }