void Start() { mWarningRenderObject = new GameObject("WarningRenderObject"); mBombExplodeFactory = GameObject.Find("SystemManager").GetComponent <BombExplodeFactory>(); for (int j = 0; j < Const.TileCntY; j++) { for (int i = 0; i < Const.TileCntX; i++) { int idx = i + j * Const.TileCntX; // 생성 GameObject obj = Instantiate(WarningSprite); obj.transform.parent = mWarningRenderObject.transform; // 위치 // 타일 사이즈 1 로 고정, 타일의 가운데 위치 시킴 // @TODO 유연하게 동작하도록 수정해야함 obj.transform.position = new Vector3(0.5f + i, -0.5f - j, 0.5f); // 색상 obj.GetComponent <SpriteRenderer>().color = WarningColor; mSpriteMap[idx] = obj.GetComponent <SpriteRenderer>(); if (!DebugModeOn) { obj.SetActive(false); } } } }
void Start() { mSystemManager = GameObject.Find("SystemManager"); mBombFactory = mSystemManager.GetComponent <BombFactory>(); mBombExplodeFactory = mSystemManager.GetComponent <BombExplodeFactory>(); mCharacterManager = mSystemManager.GetComponent <CharacterManager>(); mItemFactory = mSystemManager.GetComponent <ItemFactory>(); mTileMap = mSystemManager.GetComponent <TileMap>(); mCharacter = this.GetComponent <Character>(); mNearIndex = new Dictionary <int, float>(); mBestIndexList = new List <int>(); }
void Start() { mSystemManager = GameObject.Find("SystemManager"); mBombFactory = mSystemManager.GetComponent <BombFactory>(); mBombExplodeFactory = mSystemManager.GetComponent <BombExplodeFactory>(); mCharacterManager = mSystemManager.GetComponent <CharacterManager>(); mItemFactory = mSystemManager.GetComponent <ItemFactory>(); mTileMap = mSystemManager.GetComponent <TileMap>(); mCharacter = this.GetComponent <Character>(); mCurIndex = TileMap.PosToIndex(transform.position); mNextIndex = mCurIndex; CalcBehavior(); }