private void LoadModelFinished(Object obj) { if (null == obj) { this.m_log.Error("null == obj"); } else { //如果先前的模型还存在游戏中的话,就先摧毁 if (this.m_gameObject != null) { Object.Destroy(this.m_gameObject); this.m_gameObject = null; } this.m_gameObject = (GameObject)Object.Instantiate(obj); if (null == this.m_gameObject) { this.m_log.Error("m_gameObject == null"); } else { Object.DontDestroyOnLoad(this.m_gameObject); this.UpdatePosition(); this.UpdateRotation(); MapNodeBehaviour mapNodeBehaviour = this.m_gameObject.AddComponent <MapNodeBehaviour>(); mapNodeBehaviour.MapNodeBuilding = this; this.m_gameObject.SetActive(this.m_bVisible); if (EMapNodeType.MAP_NODE_EMPIRE_BASE == this.MapNodeType || EMapNodeType.MAP_NODE_LEAGUE_BASE == this.MapNodeType) { mapNodeBehaviour.SetHighLightData(); } } } }
public void Init(MapNodeBehaviour mapNodeBehaviour) { this.m_mapNodeBehaviour = mapNodeBehaviour; Vector3 hex3DPos = Hexagon.GetHex3DPos(this.m_vec3HexPos, Space.World); this.m_mapNodeBehaviour.transform.position = hex3DPos; this.m_mapNodeBehaviour.IsHighlight = this.m_bHighlight; this.m_mapNodeBehaviour.IsAffect = this.m_bAffect; this.UpdatePosition(); this.UpdateRotation(); }