Exemple #1
0
    void Start()
    {
        m_Radius   = s_RecentRadius;
        m_Hardness = s_RecentHardness;
        m_Strength = s_RecentStrength;

        m_GLCursor.m_Airbrush = this;
        m_MeshMgr             = VCEditor.Instance.m_MeshMgr;

        // continous drawing vars
        m_simDist  = VCEditor.s_Scene.m_Setting.EditorWorldSize.magnitude * 0.2f;
        m_lastHit  = Vector3.zero;
        m_lastDraw = Vector3.one * (-100);

        // Inspector
        m_Inspector = VCEUIFreeAirbrushInspector.Instantiate(m_InspectorRes) as VCEUIFreeAirbrushInspector;
        m_Inspector.transform.parent        = VCEditor.Instance.m_UI.m_InspectorGroup;
        m_Inspector.transform.localPosition = new Vector3(0, -10, 0);
        m_Inspector.transform.localScale    = Vector3.one;
        m_Inspector.m_ParentBrush           = this;
        m_Inspector.gameObject.SetActive(true);

        if (m_Eraser)
        {
            VCEStatusBar.ShowText("Eraser - Erase color on voxel blocks".ToLocalizationString(), 7, true);
        }
        else
        {
            VCEStatusBar.ShowText("Airbrush - Paint color on voxel blocks".ToLocalizationString(), 7, true);
        }
    }
Exemple #2
0
 void OnDestroy()
 {
     // Inspector
     if (m_Inspector != null)
     {
         GameObject.Destroy(m_Inspector.gameObject);
         m_Inspector = null;
     }
 }