// Use this for initialization void Start() { waitTime = 1.0f / fps; rotateDegreePerSecond = 1000f; originalRotationValue = transform.rotation; cw = true; alphaSpeed = 0.03f; isReady = false; manager = GameObject.Find("_Manager").GetComponent <CameraScript>(); rareCard = GetComponentInChildren <RareCard>(); randomCard = GetComponentInChildren <RandomCard>(); rareCard.disableRare(); ripple = GetComponentInChildren <rippleSharp>(); ripple.disableObject(); Gameback = GetComponentInChildren <BackCard>(); cheat = false; }
public void resetCard() { Gameback.enableObject(); if ((mode == 0) || (mode == 2)) { transform.rotation = Quaternion.Slerp(transform.rotation, originalRotationValue, Time.time * 1.0f); rareCard.transform.localPosition = new Vector3(0, 0, -rareOffset); } else if (mode == 1) { if (randomCard.rare) { Vector3 oldTransform = ripple.transform.localScale; ripple.transform.localScale = new Vector3(-oldTransform.x, oldTransform.y, -oldTransform.z); Quaternion rotation = Quaternion.identity; rotation.eulerAngles = new Vector3(90f, 0, 0); ripple.transform.localRotation = rotation; } else { //RandomCard randCard = GetComponentInChildren<RandomCard>(); // randCard.GetComponent<Transform>().localScale = new Vector3(-1f, 1f, 1f); BackCard backCard = GetComponentInChildren <BackCard>(); SpriteRenderer sprite = backCard.GetComponent <SpriteRenderer>(); sprite.color = new Vector4(1f, 1f, 1f, 1f); } } cheat = false; rareCard.disableRare(); randomCard.enableObject(); ripple.enableObject(0); isFaceUp = false; isReady = false; MainCard mainCard = GetComponent <MainCard>(); mainCard.reset(); //GetComponentInChildren<RandomCard>().randomizeCards(manager.currentPack); }
// Use this for initialization void Start() { waitTime = 1.0f / fps; rotateDegreePerSecond = 1000f; originalRotationValue = transform.rotation; cw = true; alphaSpeed = 0.03f; isReady = false; manager = GameObject.Find("_Manager").GetComponent<CameraScript>(); rareCard = GetComponentInChildren<RareCard>(); randomCard = GetComponentInChildren<RandomCard>(); rareCard.disableRare(); ripple = GetComponentInChildren<rippleSharp>(); ripple.disableObject(); Gameback = GetComponentInChildren<BackCard>(); cheat = false; }