private int m_spinCheck = 0; // 检查金币是否有误 // Use this for initialization void Start() { // 为所有按钮添加点击事件 // 部分没有点击事件 for (int i = 0; i < Constants.Btn_Strings.Length; ++i) { string btnName = Constants.Btn_Strings[i]; m_btnIndexDict.Add(btnName, i); GameObject btnObj = GameObject.Find(btnName); if (btnObj == null) { DebugConsole.Log(btnName); } if (btnObj != null) { Button btn = btnObj.GetComponent <Button>(); btn.onClick.AddListener(delegate() { this.OnClick(btnObj); }); } } m_clerk = GameObject.Find("SlotClerk").GetComponent <SlotClerk>(); }
// Use this for initialization void Start() { m_scrollRect = gameObject.GetComponent <ScrollRect>(); m_initPosition = m_scrollRect.content.localPosition; m_a1 = 1.1f / 0.6f; m_a2 = 1.1f / 0.8f; m_a3 = 1.1f / 1.2f; m_posYArray[0] = StartPositionY; // 2的替代值 m_posYArray[1] = StartPositionY + ItemHeight * 4; m_posYArray[2] = StartPositionY + ItemHeight * 0; m_posYArray[3] = StartPositionY + ItemHeight * 1; m_posYArray[4] = StartPositionY + ItemHeight * 2; m_posYArray[5] = StartPositionY + ItemHeight * 3; m_clerk = GameObject.Find("SlotClerk").GetComponent <SlotClerk>(); }