Пример #1
0
    private void OnEnable()
    {
        navNet = (TeleportNavigationNetwork)target;
        nodes  = navNet.GetComponentsInChildren <LocationNode>();

        locationPointStyle                  = new GUIStyle();
        locationPointStyle.fontSize         = 20;
        locationPointStyle.alignment        = TextAnchor.UpperCenter;
        locationPointStyle.normal.textColor = Color.yellow;
    }
Пример #2
0
    private void OnEnable()
    {
        targetNode  = (LocationNode)target;
        connections = serializedObject.FindProperty("edges");

        TeleportNavigationNetwork currentNetwork = FindObjectOfType <TeleportNavigationNetwork>();

        if (currentNetwork == null)
        {
            GameObject newSystem = new GameObject("TeleportNetwork");
            newSystem.AddComponent <TeleportNavigationNetwork>();
            targetNode.transform.parent = newSystem.transform;
        }
        else
        {
            if (PrefabUtility.GetPrefabInstanceStatus(targetNode.gameObject) != PrefabInstanceStatus.NotAPrefab)
            {
                targetNode.transform.parent = currentNetwork.transform;
            }
        }


        ExitPointPrefab = AssetDatabase.LoadAssetAtPath("Assets/Level/Prefabs/P_ExitPoint.prefab", typeof(GameObject)) as GameObject;
    }