Пример #1
0
        static void Initialize()
        {
            var ga = new GameObject();

            PrefabFolder.ResourcesLoadInstantiateTo("GameController", ga.transform.parent);
            Object.Destroy(ga);
        }
Пример #2
0
    void LoadItem(List <ItemModel> masterData)
    {
        mItemModel = masterData.Where(i => i.mId == mItemId).FirstOrDefault();
        var prefab = (GameObject)Resources.Load("Item/" + mItemModel.mGraphicPath);

        mImage = PrefabFolder.InstantiateTo <Image> (prefab, this.transform);
    }
Пример #3
0
 public StoryWindw OpenStoryWindw(List <StoryModel> masterStoryData)
 {
     mStoryWindw = PrefabFolder.InstantiateTo <StoryWindw> (mStoryWindwPrefab, mCanvas.transform);
     mStoryWindw.Init(masterStoryData, () => {
         mStoryWindw = null;
     });
     return(mStoryWindw);
 }
Пример #4
0
    /// <summary>
    /// プレイヤーの所持アイテムを増やす
    /// </summary>
    /// <param name="item">Item.</param>
    public void AddPlayerItem(AdvItemModel item)
    {
        IndicationItemPresenter iteDisplay = PrefabFolder.InstantiateTo <IndicationItemPresenter> (mIndicationItemPrefab, mGrid.transform);

        iteDisplay.Init(item, RepostionItems);
        ItemList.Add(iteDisplay);
        UpDateItemDisplay();
    }
Пример #5
0
        static void GameSystemInitialize()
        {
            Debug.Log("OnRuntimeMethodLoad");
            //var ga = new GameObject();
            var obj = PrefabFolder.ResourcesLoadInstantiateTo("UIController");

            Object.DontDestroyOnLoad(obj);
        }
Пример #6
0
    public void Init(AdvItemModel item, Action endDragCallback)
    {
        this.mItem = item;
        var prefab = (GameObject)Resources.Load("Item/" + item.ItemModel.mGraphicPath);

        mImage = PrefabFolder.InstantiateTo <Image> (prefab, this.transform);
        var rect = this.GetComponent <RectTransform> ();

        mImage.rectTransform.sizeDelta = rect.sizeDelta;
        mEndDragCallback = endDragCallback;
    }
Пример #7
0
        public static void GameSystemInitialize()
        {
            //var _controller = Object.FindObjectOfType<EscapeGameController>();
            //if(_controller != null)
            //{
            //    Object.Destroy(_controller.gameObject);
            //    ViewExtensions.CashClear();
            //}
#if UNITY_EDITOR
            var ga         = new GameObject();
            var controller = PrefabFolder.ResourcesLoadInstantiateTo("BLDKOutGameModules", ga.transform.parent);
            //var itemWindow = PrefabFolder.ResourcesLoadInstantiateTo("ItemWindowView", ga.transform.parent);
            Object.Destroy(ga);
            Object.DontDestroyOnLoad(controller);
#endif
            //Object.DontDestroyOnLoad(itemWindow);
        }
Пример #8
0
 void CreateMapUI()
 {
     Debug.Log("CreateMapUI");
     foreach (var m in mMasterMapData)
     {
         PropertyInfo[] infoArray = m.mModel.GetType().GetProperties();
         foreach (var i in infoArray)
         {
             int verticalNumber = int.Parse(i.Name.Replace(GameDef.MAP_PROPERTIE_PREFIX, ""));
             if (m.GetValueFromVerticalNumber(verticalNumber) != "")
             {
                 var cell = PrefabFolder.InstantiateTo <CellPresenter> (mCellPresenterPrefab, mGrid.transform);
                 cell.Init(m, verticalNumber);
                 mCellObjectList.Add(cell);
             }
         }
     }
 }
Пример #9
0
    /// <summary>
    /// プレイヤーの位置からゲームスクリーンを更新
    /// </summary>
    /// <param name="player">Player.</param>
    public void UpdateGameScreneFromPlayerPostion(PlayerPresenter player)
    {
        if (mCurrentGameScreen != null)
        {
            DestroyImmediate(mCurrentGameScreen.gameObject);
            mCurrentGameScreen = null;
        }
        // プレハブを取得
        GameObject prefab;

        if (GameManager.Instance.UseDirection)
        {
            prefab = (GameObject)Resources.Load("GameScreens/" + Application.loadedLevelName + "/" + player.Coordinate.x + "_" + player.Coordinate.y + "_" + player.CurrentDirection.ToString());
        }
        else
        {
            prefab = (GameObject)Resources.Load("GameScreens/" + Application.loadedLevelName + "/" + player.Coordinate.x + "_" + player.Coordinate.y);
        }

        mCurrentGameScreen = PrefabFolder.InstantiateTo <GameScreenPresenter> (prefab, this.transform);
    }