void Start() { m_playspaceManager = PlayspaceManager.Instance; m_currentMission = new Mission1(); // // Single-color, flat-shaded material. HoloToolkit/Vertex Lit Configurable // appears optimized to compile down to only the variant defined by // keywords. I'm not sure how Unity translates e.g. the editor color // "Enabled" tick box to _USECOLOR_ON but apparently it somehow does. Unity // manual seems to imply that "#pragma shader_feature X" will not include // unused variants of the shader in a build. If this code stops working, // may need to use a dummy asset with these material settings somewhere? // //flatMaterial = new Material(Shader.Find("HoloToolkit/Vertex Lit Configurable")); //flatMaterial.EnableKeyword("_USECOLOR_ON"); //flatMaterial.DisableKeyword("_USEMAINTEX_ON"); //flatMaterial.DisableKeyword("_USEEMISSIONTEX_ON"); }
void Awake() { m_audioSource = GetComponent <AudioSource>(); m_lockIndicatorHelper = GetComponent <LockIndicatorHelper>(); m_currentMission = LevelManager.Instance.currentMission; m_boxCollider = GetComponent <BoxCollider>(); // Find bones Transform[] transforms = GetComponentsInChildren <Transform>(); foreach (Transform xform in transforms) { if (xform.name == "TurretBone") { m_turret = xform; } else if (xform.name == "GunBone") { m_gun = xform; } } m_gunZeroRotation = m_gun.localRotation; }