예제 #1
0
        public override void OnInspectorGUI()
        {
            PathGame myTarget = (PathGame)target;

            EditorGUI.BeginChangeCheck();
            GUILayout.Label("Name:");
            string gName = EditorGUILayout.TextField(myTarget.name);

            GUILayout.Label("Author:");
            string gAuthor = EditorGUILayout.TextField(myTarget.autor);

            GUILayout.Label("Description:");
            string gDescription = EditorGUILayout.TextField(myTarget.description, GUILayout.Height(120));

            if (EditorGUI.EndChangeCheck())
            {
                Undo.RecordObject(myTarget, "Edit PathGame");
                myTarget.gameName = gName;
                string assetPath = AssetDatabase.GetAssetPath(myTarget.GetInstanceID());
                AssetDatabase.RenameAsset(assetPath, assetPath.Replace(assetPath, gName));
                myTarget.autor       = gAuthor;
                myTarget.description = gDescription;
            }
            if (GUILayout.Button("Edit"))
            {
                QuestWindow.Init(myTarget);
            }
        }
예제 #2
0
 public void Init(PathGame game)
 {
     this.game = game;
     game.chains.Insert(0, this);
     dialogName = "New chain";
     name       = dialogName;
 }
예제 #3
0
        public void Init(Chain chain)
        {
            this.game  = chain.Game;
            this.chain = chain;
            state      = chain.StartState;
            float z = 1;

            z        = game.zoom;
            position = new Rect(0, 0, 208 * z, 30 * z);
        }
예제 #4
0
 private void OnEnable()
 {
     link = (StateLink)target;
     game = AssetDatabase.LoadAssetAtPath <PathGame>(AssetDatabase.GetAssetPath(link)) as PathGame;
     if (link.chain == null)
     {
         link.chain = game.chains[0];
         link.state = link.chain.StartState;
     }
 }
예제 #5
0
        public void Init(Chain chain)
        {
            Guid        = GuidManager.GetStateGuid();
            this.chain  = chain;
            game        = chain.Game;
            description = "";
            float z = 1;

            z        = game.zoom;
            position = new Rect(300, 300, 208 * z, 30 * z);
        }