Inheritance: MonoBehaviour
Exemplo n.º 1
0
    //Material Material;

    void Awake()
    {
        renderer = GetComponent <MeshRenderer>();
        filter   = GetComponent <MeshFilter>();
        poly     = GetComponent <PolyCollider>();

        SetVerts();
    }
Exemplo n.º 2
0
    //Material Material;
    void Awake()
    {
        renderer = GetComponent<MeshRenderer>();
        filter = GetComponent<MeshFilter>();
        poly = GetComponent<PolyCollider>();

        SetVerts();
    }
Exemplo n.º 3
0
    private void OnEnable()
    {
        handleIconNormal = (Texture2D)Resources.LoadAssetAtPath("Assets/Resources/Icons/HandleIcon-Normal.png", typeof(Texture2D));
        handleIconActive = (Texture2D)Resources.LoadAssetAtPath("Assets/Resources/Icons/HandleIcon-Active.png", typeof(Texture2D));

        deleteIconNormal = (Texture2D)Resources.LoadAssetAtPath("Assets/Resources/Icons/DeletePoint-Normal.png", typeof(Texture2D));
        deleteIconActive = (Texture2D)Resources.LoadAssetAtPath("Assets/Resources/Icons/DeletePoint-Active.png", typeof(Texture2D));

        insertIconNormal = (Texture2D)Resources.LoadAssetAtPath("Assets/Resources/Icons/InsertPoint-Normal.png", typeof(Texture2D));
        insertIconActive = (Texture2D)Resources.LoadAssetAtPath("Assets/Resources/Icons/InsertPoint-Active.png", typeof(Texture2D));

        insertIconStyle = new GUIStyle();
        insertIconStyle.normal.background = insertIconNormal;
        insertIconStyle.active.background = insertIconActive;

        deletePointStyle = new GUIStyle();
        deletePointStyle.normal.background = deleteIconNormal;
        deletePointStyle.active.background = deleteIconActive;

        if (Undo.undoRedoPerformed != UndoRedoPerformed)
        {
            Undo.undoRedoPerformed += UndoRedoPerformed;
        }

		timeSlider = 0.0f;

        poly = (PolyCollider)target;
        snapEnabled = EditorPrefs.HasKey("polyCollider_snapEnabled") ? EditorPrefs.GetBool("polyCollider_snapEnabled") : false;
        snapValue = EditorPrefs.HasKey("polyCollider_snapValue") ? EditorPrefs.GetFloat("polyCollider_snapValue") : 0.25f;
    
	
		awakeTime = poly._awakeTime;
		deathTime = poly._deathTime;
		startTime = poly._startTime;
		endTime = poly._endTime;
		
		polyStartEndDiff = startTime - endTime;
	}