public FingerTouch(RoleScrollStruct dataStruct) { this._dataStruct = dataStruct; //注册事件 Globals.Instance.MFingerEvent.AddUIObjectEventListener(this); SetFingerEventActive(true); }
public SingleScrollPanel(Transform parent, RoleScrollStruct dataStruct, int nodeIndex, string animationName) // panelIndex is from zero on { //set the aspect this._dataStruct = dataStruct; this._nodeIndex = nodeIndex; //set the node index this.animationName = animationName; roleBG = GameObject.Instantiate(dataStruct.roleSpriteBG) as PackedSprite; roleBG.transform.parent = parent; //创建人物头像 avatarSprite = GameObject.Instantiate(dataStruct.avatarSprite) as PackedSprite; avatarSprite.transform.parent = roleBG.transform; avatarSprite.transform.localPosition = new Vector3(0, -13.4f, -1f); avatarSprite.PlayAnim(animationName); roleBG2 = GameObject.Instantiate(dataStruct.roleSpriteBG2) as PackedSprite; roleBG2.transform.parent = roleBG.transform; roleBG2.transform.localPosition = new Vector3(0, 0, avatarSprite.transform.localPosition.z - 1.0f); roleBG2.transform.localScale = Vector3.one; //set the transform roleBG.transform.localPosition = Node._position[nodeIndex]; roleBG.transform.localScale = Node._scale[nodeIndex]; // if(nodeIndex == 2) // { // roleBG.PlayAnim("Active"); // } // else // { // roleBG.PlayAnim("Normal"); // } if (nodeIndex == MaxRoleCnt / 2) // if(nodeIndex == 2) { roleBG2.transform.localScale = Vector3.one; } else { roleBG2.transform.localScale = Vector3.zero; } }