Ejemplo n.º 1
0
 public static void InvokeChangedKeyStyle(KeyStyleType style)
 {
     if (OnChangedKeyStyle != null)
     {
         OnChangedKeyStyle(style);
     }
 }
    public void UpdateBowPartSprite(KeyStyleType style)
    {
        bowPart.material = MaterialsController.Instance.SelectedMaterial;
        bowPart.style    = style;

        switch (bowPart.material)
        {
        case MaterialType.Copper:
            if (MaterialsController.Instance.CopperPieces < 15)
            {
                return;
            }

            MaterialsController.Instance.CopperPieces -= 15;
            switch (bowPart.style)
            {
            case KeyStyleType.Simple:
                keyBowGameObject.GetComponent <Image> ().sprite = ShapesController.Instance.copperSimpleBow;
                break;

            case KeyStyleType.Cute:
                keyBowGameObject.GetComponent <Image> ().sprite = ShapesController.Instance.copperCuteBow;
                break;

            case KeyStyleType.Fancy:
                keyBowGameObject.GetComponent <Image> ().sprite = ShapesController.Instance.copperFancyBow;
                break;
            }
            break;

        case MaterialType.Silver:
            if (MaterialsController.Instance.SilverPieces < 15)
            {
                return;
            }

            MaterialsController.Instance.SilverPieces -= 15;
            switch (bowPart.style)
            {
            case KeyStyleType.Simple:
                keyBowGameObject.GetComponent <Image> ().sprite = ShapesController.Instance.silverSimpleBow;
                break;

            case KeyStyleType.Cute:
                keyBowGameObject.GetComponent <Image> ().sprite = ShapesController.Instance.silverCuteBow;
                break;

            case KeyStyleType.Fancy:
                keyBowGameObject.GetComponent <Image> ().sprite = ShapesController.Instance.silverFancyBow;
                break;
            }
            break;

        case MaterialType.Gold:
            if (MaterialsController.Instance.GoldPieces < 15)
            {
                return;
            }

            MaterialsController.Instance.GoldPieces -= 15;
            switch (bowPart.style)
            {
            case KeyStyleType.Simple:
                keyBowGameObject.GetComponent <Image> ().sprite = ShapesController.Instance.goldenSimpleBow;
                break;

            case KeyStyleType.Cute:
                keyBowGameObject.GetComponent <Image> ().sprite = ShapesController.Instance.goldenCuteBow;
                break;

            case KeyStyleType.Fancy:
                keyBowGameObject.GetComponent <Image> ().sprite = ShapesController.Instance.goldenFancyBow;
                break;
            }
            break;
        }
    }
Ejemplo n.º 3
0
 public KeyPart(KeyPartType part)
 {
     this.part = part;
     material  = (MaterialType)UnityEngine.Random.Range(0, 3);
     style     = (KeyStyleType)UnityEngine.Random.Range(0, 3);
 }
Ejemplo n.º 4
0
 public KeyPart(KeyPartType part, MaterialType material, KeyStyleType style)
 {
     this.part     = part;
     this.material = material;
     this.style    = style;
 }
Ejemplo n.º 5
0
 public KeyPart(KeyPartType part, MaterialType material)
 {
     this.part     = part;
     this.material = material;
     style         = Util.GetRandomEnum <KeyStyleType> ();
 }