public void SetJewel() { SetVisible(true); jewelState = EJewelState.Stay; int jewelNum = Random.Range(0, (int)EJewelType.jewelTypeEnd); jewelType = (EJewelType)jewelNum; thisSprite.spriteName = "jewel" + (jewelNum + 1); }
public void SetJewelWithExceptionType(EJewelType jewelTypeLeft, EJewelType jewelTypeRight, EJewelType jewelTypeUp, EJewelType jewelTypeDown) { SetVisible(true); jewelState = EJewelState.Stay; int jewelNum = (int)EJewelType.jewelTypeEnd; while (jewelNum == (int)jewelTypeLeft || jewelNum == (int)jewelTypeRight || jewelNum == (int)jewelTypeUp || jewelNum == (int)jewelTypeDown || jewelNum == (int)EJewelType.jewelTypeEnd) { jewelNum = Random.Range(0, (int)EJewelType.jewelTypeEnd); } jewelType = (EJewelType)jewelNum; thisSprite.spriteName = "jewel" + (jewelNum + 1); }
private void Awake() { isClicked = false; jewelType = EJewelType.jewel1; jewelState = EJewelState.Stay; thisSprite = GetComponent <UISprite>(); thisEventTrigger = GetComponent <UIEventTrigger>(); thisEventTrigger.onPress.Add(new EventDelegate(OnPress)); thisEventTrigger.onRelease.Add(new EventDelegate(OnRelease)); thisEventTrigger.onDragOut.Add(new EventDelegate(DragOut)); uiCamera = UICamera.mainCamera; Color tempColor; for (int i = 0; i < particleColorList.Count; i++) { tempColor = particleColorList[i]; tempColor.a = 1; particleColorList[i] = tempColor; } }
public void DestroyJewel() { SetVisible(false); particleManager.PlayParticle(this.transform.localPosition, particleColorList[(int)jewelType]); jewelState = EJewelState.Destroyed; }