Example #1
0
 public DefaultCamera(IAudioEngine s, EventManager m, int moveTime, SceneMap parent, SaveData save)
     : base(s, m, save)
 {
     this.NoTimeNext = false;
     this.parent     = parent;
     this.moveTime   = moveTime;
 }
Example #2
0
 public StatusHide(IAudioEngine s, EventManager m, bool hide, SceneMap map, SaveData save)
     : base(s, m, save)
 {
     this.NoTimeNext = true;
     this.hide       = hide;
     this.map        = map;
 }
Example #3
0
    public static ScenePathSetting CreateScenePathSetting(SceneMap map)
    {
        var pathID = 0;
        var go     = new GameObject("ScenePathSetting-" + pathID);
        var obj    = go.AddComponent <ScenePathSetting>();

        go.transform.SetParent(map.transform);
        go.transform.position   = selectionPosition;
        go.transform.localScale = Vector3.one;
        go.transform.rotation   = Quaternion.identity;

        if (obj.StartPoint == null)
        {
            obj.StartPoint = GameObject.CreatePrimitive(PrimitiveType.Cube);
        }
        if (obj.EndPoint == null)
        {
            obj.EndPoint = GameObject.CreatePrimitive(PrimitiveType.Cube);
        }
        obj.StartPoint.name = "StartPoint";
        obj.EndPoint.name   = "EndPoint";
        obj.StartPoint.transform.SetParent(obj.transform);
        obj.EndPoint.transform.SetParent(obj.transform);
        Selection.activeGameObject = go;

        return(obj);
    }
Example #4
0
        public Credit(
            IAudioEngine s,
            EventManager m,
            string key,
            Point position,
            bool centered,
            bool movesWithCamera,
            int fadeInTime,
            int hangTime,
            int fadeOutTime,
            SceneMap parent,
            SaveData save)
            : base(s, m, save)
        {
            this.NoTimeNext = false;

            this.parent = parent;

            this.creditKey       = key;
            this.position        = new Vector2(position.X, position.Y);
            this.centered        = centered;
            this.movesWithCamera = movesWithCamera;
            this.fadeInTime      = fadeInTime;
            this.hangTime        = hangTime;
            this.fadeOutTime     = fadeOutTime;

            if (this.hangTime < 0)
            {
                this.PersistentId = this.hangTime == -1 ? this.fadeOutTime : this.fadeInTime;
            }

            this.state = CreditState.FadingIn;

            this.alpha = 0;
        }
 private void Init()
 {
     Map = new SceneMap(Game.Settings.MapWidth, Game.Settings.MapHeight);
     CreateMapRenderer();
     CreatePlayer();
     CreateControls();
 }
Example #6
0
 public InteriorSetting(IAudioEngine s, EventManager m, SceneMap parent, SaveData save)
     : base(s, m, save)
 {
     this.parent       = parent;
     this.NoTimeNext   = false;
     this.eventmanager = new EventManager(this.sound);
 }
Example #7
0
        private IEnumerator UnloadContentScenes(ContentInfo contentInfo)
        {
            // unloading scenes that may have been preloaded
            List <Scene> scenesToUnload = new List <Scene>();

            for (int i = 0; i < SceneManager.sceneCount; i++)
            {
                Scene scene = SceneManager.GetSceneAt(i);
                if (scene.path.StartsWith(contentInfo.SubmodulePath))
                {
                    scenesToUnload.Add(scene);
                }
            }

            foreach (Scene scene in scenesToUnload)
            {
                SceneReference sceneReference = SceneMap.GetSceneReference(scene.path);
                if (!string.IsNullOrEmpty(sceneReference.Guid))
                {
                    yield return(SceneNavigator.Instance.UnloadScene(sceneReference, true));
                }
            }

            yield return(null);
        }
Example #8
0
 public InteriorSet(IAudioEngine s, EventManager m, MapField field, SceneMap map, SaveData save)
     : base(s, m, save)
 {
     this.NoTimeNext = true;
     this.field      = field;
     this.map        = map;
 }
Example #9
0
 public GetMail(IAudioEngine s, EventManager m, int ID, bool effect, SceneMap map, SaveData save)
     : base(s, m, save)
 {
     this.effect     = effect;
     this.map        = map;
     this.NoTimeNext = true;
     this.number     = ID;
 }
Example #10
0
        void Awake()
        {
            sceneMap = new SceneMap();

            sceneCamera = this.gameObject.AddComponent <SceneCamera>();
            clickScene  = MouseClickScene.Create(this);
            CursorManager.GetInstance().SetCursor(CursorType.ctNormal);
        }
        public void RegisterSceneController(SceneController sceneController)
        {
            SceneReference sceneReference;

            sceneReference = SceneMap.GetSceneReference(SceneManager.GetActiveScene().path);

            RegisterSceneController(sceneController, sceneReference);
        }
Example #12
0
 public DebugMode(IAudioEngine s, SaveData savedata, SceneMap parent)
 {
     this.sound    = s;
     this.savedata = savedata;
     this.parent   = parent;
     this.menus    = Enum.GetNames(typeof(DebugMode.MENU));
     this.menuOn   = true;
     this.topmenu  = true;
 }
Example #13
0
 public static void Initialize(Player player, Map map)
 {
     Console.Clear();
     MenuDoes.DrawMenu();
     CharacterInfo.ShortSheet(player);
     MenuDoes.CommandClear();
     MenuDoes.CommandToggle(0, player.zToggle, player);
     SceneMap.DrawMap(player, map);
 }
Example #14
0
    static void CreateFlyingPath()
    {
        SceneMap sceneMap = MapManager.current;

        if (sceneMap == null)
        {
            return;
        }
        MapManager.CreateFlyingPath(sceneMap);
    }
Example #15
0
    public static void ExportScene()
    {
        Directory.CreateDirectory(outpath_scenemap);

        SceneMap sceneMap = new SceneMap();

        GameObject[] objs = (GameObject[])Resources.FindObjectsOfTypeAll(typeof(GameObject));
        foreach (GameObject go in objs)
        {
            if (PrefabUtility.GetPrefabType(go) != PrefabType.PrefabInstance)
            {
                continue;
            }

            Object parentObject = PrefabUtility.GetPrefabParent(go);
            string assetPath    = AssetDatabase.GetAssetPath(parentObject);

            if (!assetPath.StartsWith("Assets/Packages"))
            {
                continue;
            }

            string[] paths = assetPath.Split('/');
            if (paths.Length != 5)
            {
                continue;
            }

            SceneObject obj = new SceneObject();
            obj.name     = go.name;
            obj.res      = string.Format("{0}/{1}", paths[3], paths[4]);
            obj.position = go.transform.position;
            obj.rotation = go.transform.rotation.eulerAngles;
            obj.scale    = go.transform.localScale;

            double px = System.Math.Round(obj.position.x, 4);
            double py = System.Math.Round(obj.position.y, 4);
            double pz = System.Math.Round(obj.position.z, 4);
            double rx = System.Math.Round(obj.rotation.x, 4);
            double ry = System.Math.Round(obj.rotation.y, 4);
            double rz = System.Math.Round(obj.rotation.z, 4);
            double sx = System.Math.Round(obj.scale.x, 4);
            double sy = System.Math.Round(obj.scale.y, 4);
            double sz = System.Math.Round(obj.scale.z, 4);
            obj.position = new Vector3((float)px, (float)py, (float)pz);
            obj.rotation = new Vector3((float)rx, (float)ry, (float)rz);
            obj.scale    = new Vector3((float)sx, (float)sy, (float)sz);

            sceneMap.objs.Add(obj);
        }
        string json = JsonUtility.ToJson(sceneMap, true);

        File.WriteAllText(Path.Combine(outpath_scenemap, "scene.json"), json);
        Debug.Log("export scene at " + outpath_scenemap);
    }
Example #16
0
    static void CreatePathNode()
    {
        SceneMap sceneMap = MapManager.current;

        if (sceneMap == null)
        {
            return;
        }

        ScriptableWizard.DisplayWizard <PathNodeCreateWizard>("创建路点", "创建");
    }
Example #17
0
    static void CreateRectPathNode()
    {
        SceneMap sceneMap = MapManager.current;

        if (sceneMap == null)
        {
            return;
        }

        MapManager.CreateScenePathSetting(sceneMap);
    }
Example #18
0
 public RunEventParallel(
     IAudioEngine s,
     EventManager m,
     string ID,
     int p,
     SceneMap map,
     MapField fi,
     SaveData save)
     : base(s, m, ID, p, map, fi, save)
 {
     this.detachedManager = new EventManager(map, s);
 }
 public void NewSceneMapTest()
 {
     // ReSharper disable once AccessToStaticMemberViaDerivedType
     _map = MockGame.UiManager.Map;
     Assert.NotNull(_map);
     for (int i = 0; i < _map.Width; i++)
     {
         for (int j = 0; j < _map.Height; j++)
         {
             Assert.NotNull(_map.GetTerrain <BasicTerrain>(i, j));
         }
     }
 }
        protected override void Initialize()
        {
            base.Initialize();
            Scene.setDefaultDesignResolution(427, 240, Scene.SceneResolutionPolicy.FixedHeight);

            // PP Fix
            scene = Scene.createWithDefaultRenderer();
            base.Update(new GameTime());
            base.Draw(new GameTime());

            // Set first scene
            scene = new SceneMap();
        }
Example #21
0
    protected void onCreateNewSceneClick(GameObject go)
    {
        clearSceneInfo();
        string mapFileName = CommonDefine.F_STREAMING_ASSETS_PATH + "Map/" + mSceneNameEdit.getText() + ".map";

        mSceneMap = new SceneMap();
        mSceneMap.readFile(mapFileName);
        mWidthLabel.setLabel("宽:" + mSceneMap.mHeader.mWidth);
        mHeightLabel.setLabel("高:" + mSceneMap.mHeader.mHeight);
        mTileArray  = new TileTextureWindow[mSceneMap.mHeader.mWidth * mSceneMap.mHeader.mHeight];
        mHalfMap    = new Vector2(mSceneMap.mHeader.mWidth * 48 / 2.0f, mSceneMap.mHeader.mHeight * 32 / 2.0f);
        mCurViewPos = new Vector2(mSceneMap.mHeader.mWidth / 2.0f, mSceneMap.mHeader.mHeight / 2.0f);
        refreshMap();
    }
Example #22
0
 public MapEffect(
     IAudioEngine s,
     SceneMap p,
     Point po,
     int floor,
     MapField fi,
     int effectNo,
     int rendType)
     : base(s, p, po, floor, MapCharacterBase.ANGLE.none, fi)
 {
     this.position.Z = floor * (this.field.Height / 2);
     this.effect     = this.EffectSet(effectNo);
     this.rendType   = rendType;
 }
Example #23
0
 public MysteryItem(
     IAudioEngine s,
     EventManager m,
     MapField field,
     RandomMystery item,
     bool message,
     SaveData save)
     : base(s, m, save)
 {
     this.field      = field;
     this.itemData   = item;
     this.message    = message;
     this.NoTimeNext = message;
     this.parent     = m.parent;
 }
Example #24
0
 public EventMove(
     IAudioEngine s,
     EventManager m,
     int id,
     NSMap.Character.EventMove[] mo,
     SceneMap ma,
     MapField fi,
     SaveData save)
     : base(s, m, save)
 {
     this.NoTimeNext = true;
     this.ID         = id;
     this.moves      = mo;
     this.map        = ma;
     this.field      = fi;
 }
Example #25
0
 public RunEvent(
     IAudioEngine s,
     EventManager m,
     string ID,
     int p,
     SceneMap map,
     MapField fi,
     SaveData save)
     : base(s, m, save)
 {
     this.NoTimeNext   = false;
     this.eventID      = ID;
     this.page         = p - 1;
     this.field        = fi;
     this.eventmanager = new EventManager(map, this.sound);
 }
Example #26
0
 public moveCamera(
     IAudioEngine s,
     EventManager m,
     Vector2 target,
     int moveTime,
     bool relative,
     SceneMap parent,
     SaveData save)
     : base(s, m, save)
 {
     this.NoTimeNext = false;
     this.parent     = parent;
     this.relative   = relative;
     this.moveTime   = moveTime;
     this.target     = target;
 }
Example #27
0
    public static ScenePathNode CreatePathNode(SceneMap map, int nodeID, List <int> prevNodeIDs)
    {
        Transform parent = map.transform.Find("Path");

        if (parent == null)
        {
            GameObject temp = new GameObject();
            temp.name     = "Path";
            parent        = temp.transform;
            parent.parent = map.transform;
            //GameBase.GameCommon.ResetTrans(parent);
            parent.localScale    = Vector3.one;
            parent.localPosition = Vector3.zero;
            parent.localRotation = Quaternion.identity;
        }

        if (parent == null)
        {
            return(null);
        }

        GameObject go = GameObject.CreatePrimitive(PrimitiveType.Sphere);

        go.name = "PathNode-" + nodeID;

        ScenePathNode node = go.AddComponent <ScenePathNode>();

        node.nodeID      = nodeID;
        node.prevNodeIDs = new List <int>();
        if (prevNodeIDs != null && prevNodeIDs.Count > 0)
        {
            node.prevNodeIDs.AddRange(prevNodeIDs);
        }
        node.map = map;

        go.transform.parent        = parent;
        go.transform.localScale    = Vector3.one;
        go.transform.localPosition = Vector3.zero;
        go.transform.localRotation = Quaternion.identity;
        go.transform.position      = selectionPosition;

        _isUpdated = true;

        Selection.activeGameObject = go;

        return(null);
    }
Example #28
0
    public static void ExportMapNPCIDS(string path, SceneMap map)
    {
        List <string> lines = new List <string> ();
        var           line  = new List <string> ();

        lines.Add(string.Join(",", columns));
        foreach (var npc in map.npcList)
        {
            line.Add(AddCSVColumn(map.sceneId.ToString()));
            line.Add(AddCSVColumn(npc.resId));
            line.Add(AddCSVColumn(npc.objectId.ToString()));
            line.Add(AddCSVColumn(npc.transform.position.ToString()));
            lines.Add(string.Join(",", line.ToArray()));
            line.Clear();
        }
        File.WriteAllLines(path, lines.ToArray());
    }
Example #29
0
 public MysteryData(
     IAudioEngine s,
     SceneMap p,
     Point po,
     int floor,
     MapCharacterBase.ANGLE a,
     MapField fi,
     string id,
     SaveData save,
     StreamReader reader,
     RandomMystery random)
     : base(s, p, po, floor, a, fi, id, save, reader, "")
 {
     this.position.Z = this.field.Height / 2 * floor;
     this.itemData   = random;
     this.getInfo    = this.itemData.getInfo;
     this.Update();
 }
Example #30
0
    public static void CreateNPCGroup(SceneMap map, int delayTime)
    {
        int groupId = AutoIncrementGenerator.Get(map.GetComponentsInChildren <SceneNPCGroup>());
        var go      = new GameObject("组-" + groupId);
        var group   = go.AddComponent <SceneNPCGroup>();

        group.groupId   = groupId;
        group.delayTime = delayTime;

        go.transform.SetParent(map.transform);
        go.transform.position   = selectionPosition;
        go.transform.localScale = Vector3.one;
        go.transform.rotation   = Quaternion.identity;

        Selection.activeGameObject = go;

        _isUpdated = true;
    }