// Use this for initialization public void Start() { navMapManager = HexNavMapManager.GetInstance(); GameObject weight = GameObject.Find("HexNavMap"); heroWeight = weight.GetComponent <Weight> (); StartCoroutine(SetAllValue()); //给每个网格的WeightValue赋值 }
// Update is called once per frame void Update() { hexNav = HexNavMapManager.GetInstance(); heroObject = GameObject.Find(hexNav.indexSelectedTile.ToString()); if (heroObject != null) { heroHex = heroObject.GetComponent <HexTile> (); } if (heroHex.unit != null) { hero = heroHex.unit.GetComponent <Hero>(); } }
// Use this for initialization void Start() { //设置屏幕自动旋转, 并置支持的方向 Screen.orientation = ScreenOrientation.Portrait; Screen.autorotateToLandscapeLeft = false; Screen.autorotateToLandscapeRight = false; Screen.autorotateToPortrait = true; Screen.autorotateToPortraitUpsideDown = false; hexNavMapManager = HexNavMapManager.GetInstance(); if (hexNavMapManager) { DeployHero(); //部署英雄,敌人,道具 DeployEnemy(); //部署英雄,敌人,道具 DeployProp(); //部署英雄,敌人,道具 } }
// Use this for initialization void Start() { navMapManager = HexNavMapManager.GetInstance(); }