UpdateModel() public méthode

public UpdateModel ( ) : void
Résultat void
Exemple #1
0
    private void InitController(int index)
    {
        if (controller == null)
        {
            controller = SteamVR_Controller.Input(index);
            gameObject.AddComponent <SteamVR_TrackedObject>().index = (SteamVR_TrackedObject.EIndex)index;

            //
            // Update and show SteamVR_RenderModel
            //
            if (createRenderModel)
            {
                renderModel = new GameObject("SteamVR_RenderModel").AddComponent <SteamVR_RenderModel>();
                renderModel.transform.parent        = transform;
                renderModel.transform.localPosition = Vector3.zero;
                renderModel.transform.localRotation = Quaternion.identity;
                renderModel.transform.localScale    = Vector3.one;
            }
            else
            {
                renderModel = GetComponentInChildren <SteamVR_RenderModel>();
            }

            if (renderModel != null)
            {
                renderModel.modelOverride = null;
                renderModel.index         = (SteamVR_TrackedObject.EIndex)index;
                renderModel.enabled       = true;
                renderModel.UpdateModel();
            }

            this.BroadcastMessage("OnHandInitialized", index, SendMessageOptions.DontRequireReceiver);               // let child objects know we've initialized
        }
    }