Example #1
0
        public override void OnInspectorGUI()
        {
            LevelMonster pElem = target as LevelMonster;

            int pId = EditorGUILayout.IntField("Id", pElem.Id);

            if (pElem.Id != pId)
            {
                pElem.Id = pId;
                pElem.SetName();
            }

            EditorGUILayout.Space();
            LevelPathNodeSet pSet = (LevelPathNodeSet)EditorGUILayout.ObjectField("巡逻路径", pElem.PatrolPathNodeSet, typeof(LevelPathNodeSet), true);

            if (pSet != pElem.PatrolPathNodeSet)
            {
                pElem.PatrolPathNodeSet = pSet;
            }
        }
Example #2
0
        public override void Import(XmlObject pData, bool pBuild)
        {
            MapNpc data = pData as MapNpc;

            Id = data.Id;

            Position = data.Position;
            Euler    = data.Euler;
            Talks    = data.Talks;
            Scale    = data.Scale;

            if (data.PatrolPathNodeSet != null)
            {
                GameObject go = new GameObject();
                go.transform.parent           = transform;
                go.transform.localPosition    = Vector3.zero;
                go.transform.localEulerAngles = Vector3.zero;
                PatrolPathNodeSet             = go.AddComponent <LevelPathNodeSet>();
                PatrolPathNodeSet.Import(data.PatrolPathNodeSet, pBuild);
            }

            this.Build();
            this.SetName();
        }