protected SpinObject mSpinObject; //< 主窗口旋转预览角色脚本对象aa void Awake() { mSpinObject = this.gameObject.GetComponent <SpinObject>(); if (m_SelectRoleWndObject) { mSelectRole = m_SelectRoleWndObject.GetComponent <SelectRole>(); } // 根据分辨率调整显示... GameObject obj = GameObject.Find("sp_link"); if (obj != null) { float r = 1.777f / ((float)Screen.width / (float)Screen.height) - 1.0f; float y = (1280.0f / (float)Screen.width * (float)Screen.height - 720.0f) / 2.0f + 1000.0f; // 16:9下的y为1000,4:3下的y为1120 obj.GetComponent <TweenPosition>().from.y = y; obj.GetComponent <TweenPosition>().to.y = y - 612.0f - 240.0f * r; // 对4:3屏幕,r=0.33,锁链长度一共会增长80 } // 对应3:2以上比例的屏幕,把主角圆盘右移一些... obj = GameObject.Find("city_construct_halidom02"); if (obj != null) { if (((float)Screen.width / (float)Screen.height) <= 1.5) { obj.transform.localPosition = new Vector3(-0.5f, obj.transform.localPosition.y, obj.transform.localPosition.z); } } // 如果一个角色都没创建过,则自动跳到角色创建界面. if (SDNetGlobal.playerList[0] == null && SDNetGlobal.playerList[1] == null && SDNetGlobal.playerList[2] == null && SDNetGlobal.playerList[3] == null) { mSelectRole.CreateChar(); } }
void OnClick() { // 当前已经选中此项目了,且正在播放SHOW动作... if (m_bSelected && m_SelectChar.mLoginChar != null && m_SelectChar.mLoginChar.IsShowAnimPlaying()) { return; } if (m_isEmpty) { if (m_SelectRole) { m_SelectRole.CreateChar(); //< 进入角色创建界面aa } } else { // 如果别的条目正在播放SHOW动作,则停止之前项的特效.. if (m_SelectChar.mLoginChar != null && m_SelectChar.mLoginChar.IsShowAnimPlaying()) { GameObject EffectNode = sdGameLevel.instance.effectNode; if (EffectNode != null) { sdAutoDestory[] effects = EffectNode.GetComponentsInChildren <sdAutoDestory>(); foreach (sdAutoDestory e in effects) { e.Life = 0; } } } doSelect(); //< 显示选中效果aa if (m_SelectRole) { m_SelectRole.doSelect(m_RoleID); //< 选中角色aa } } }