コード例 #1
0
        protected override void Start()
        {
            base.Start();

            if (m_source == null)
            {
                m_source = GetComponent <AudioSource>();
            }

            if (m_source == null)
            {
                Debug.LogError("Set AudioSource");
            }

            if (m_max)
            {
                m_gizmo                 = gameObject.AddComponent <AudioSourceGizmo>();
                m_gizmo.LineColor       = LineColor;
                m_gizmo.HandlesColor    = HandlesColor;
                m_gizmo.SelectionColor  = SelectionColor;
                m_gizmo.SelectionMargin = SelectionMargin;
                m_gizmo.EnableUndo      = EnableUndo;
                m_gizmo.m_max           = !m_max;
                m_gizmo.Window          = Window;
            }

            RTECamera.RefreshCommandBuffer();
        }
コード例 #2
0
        protected override void AwakeOverride()
        {
            if (m_source == null)
            {
                m_source = GetComponent <AudioSource>();
            }

            if (m_source == null)
            {
                Debug.LogError("Set AudioSource");
            }


            if (gameObject.GetComponents <AudioSourceGizmo>().Count(a => a.m_source == m_source) == 1)
            {
                AudioSourceGizmo gizmo = gameObject.AddComponent <AudioSourceGizmo>();
                gizmo.LineColor       = LineColor;
                gizmo.HandlesColor    = HandlesColor;
                gizmo.SelectionColor  = SelectionColor;
                gizmo.SelectionMargin = SelectionMargin;
                gizmo.EnableUndo      = EnableUndo;
                gizmo.m_max           = !m_max;
            }

            base.AwakeOverride();
        }