Exemple #1
0
        protected override void Awake()
        {
            base.Awake();

            m_Renderer = this.GetComponent <MeshRenderer>();
            m_TileSet  = GameObject.Find("TileSet").GetComponent <TileSetPathFind>();
        }
        public static void CreateCubeTileSetScene()
        {
            // ===============================================
            // camera setting
            if (GameObject.Find("Main Camera") == null || Camera.main == null)
            {
                GameObject cameraObj = new GameObject();
                cameraObj.name = "Main Camera";
                cameraObj.AddComponent <Camera>();
                cameraObj.AddComponent <AudioListener>();
                cameraObj.AddComponent <Camera3DController>();

                Camera cam = cameraObj.GetComponent <Camera>();
                cam.orthographic = false;
            }
            // ===============================================

            //
            GameObject tileSetObj = new GameObject();

            tileSetObj.name = "TileSet";
            tileSetObj.AddComponent <DemoCubeTilemap.TileSetPathFind>();

            DemoCubeTilemap.TileSetPathFind tileset = tileSetObj.GetComponent <DemoCubeTilemap.TileSetPathFind>();
            tileset.m_TileShape = eTileShape.Cube;


            // =====================================================================
            GameObject rootObj = new GameObject();

            rootObj.name = "TBGameKit_Editors";

            AddCubeTileSetSceneScript <SceneEditor>(rootObj.transform, "SceneEditor");

            AddCubeTileSetSceneScript <GameEditor>(rootObj.transform, "GameEditor");

            AddCubeTileSetSceneScript <TileMapEditor>(rootObj.transform, "TileMapEditor");

            AddCubeTileSetSceneScript <TileEditor>(rootObj.transform, "TileEditor");

            AddCubeTileSetSceneScript <CampEditor>(rootObj.transform, "CampEditor");

            AddCubeTileSetSceneScript <SpawnEditor>(rootObj.transform, "SpawnEditor");

            AddCubeTileSetSceneScript <UnitEditor>(rootObj.transform, "UnitEditor");

            AddCubeTileSetSceneScript <UnitStatEditor>(rootObj.transform, "UnitStatEditor");

            AddCubeTileSetSceneScript <AIEditor>(rootObj.transform, "AIEditor");
        }
Exemple #3
0
        protected override void Awake()
        {
            base.Awake();

            m_TileSetPathFind = this.GetComponent <TileSetPathFind>();
        }