void SetupType(CatTypeRiki typeRiki) { t.localScale = smallScreen ? typeRiki.scale * 1.1f : typeRiki.scale; onClickSound.clip = typeRiki.onFreeFXSound; dokko.Hide(); olga.Hide(); krash.Hide(); rosa.Hide(); if (typeRiki == gameplay.basicCats[0]) { rikiImage = dokko; dokko.gameObject.SetActive(true); } else if (typeRiki == gameplay.basicCats[1]) { rikiImage = olga; olga.gameObject.SetActive(true); } else if (typeRiki == gameplay.basicCats[2]) { rikiImage = krash; krash.gameObject.SetActive(true); } else if (typeRiki == gameplay.basicCats[3]) { rikiImage = rosa; rosa.gameObject.SetActive(true); } }
public override void ChangeType(CatType newType) { type = newType; typeRiki = type as CatTypeRiki; SetupType(typeRiki); if (isCoin) { rikiImage.candy.SetActive(true); } else if (isHeart) { // TODO } else if (isBat) { // TODO } else if (isMultiplier) { rikiImage.multiplier.SetActive(true); rikiImage.multiplierText.text = "x" + (gameplay.multiplier + 1); } else { rikiImage.idle.SetActive(true); } }
public override void Setup(bool isMultiplier) { typeRiki = type as CatTypeRiki; radiusNormal = (shape as CircleCollider2D).radius; SetupType(typeRiki); if (isMultiplier) { SetMultiplier(); gameplay.multiplierDroped++; } else if (gameplay.multiplierDroped < balance.multiplierGetting.Length && gameplay.multiplierProgress > balance.multiplierGetting[gameplay.multiplierDroped] && Random.value < 0.2f) { SetMultiplier(); gameplay.multiplierProgress -= balance.multiplierGetting[gameplay.multiplierDroped]; gameplay.multiplierDroped++; } else if (Missions.isGoldfishes && Random.value > 1f - balance.reward.getCoinChance * achievements.moreGoldfishes) { SetCoin(); } else if (Events.newYear.isActive && !Events.newYear.isHaveGift && !Events.newYear.isItemTryDrop && gameplay.seconds < balance.reward.timeDropEventItem) { Events.newYear.isItemTryDrop = true; if (Random.value > 0.4f) { isHat = true; hatImage.gameObject.SetActive(true); } } else if (Events.stValentin.isActive && !Events.stValentin.isHaveGift && !Events.stValentin.isItemTryDrop && gameplay.seconds < balance.reward.timeDropEventItem) { Events.stValentin.isItemTryDrop = true; if (Random.value > 0.4f) { isHeart = true; image.sprite = type.spriteHeart; } } else if (Events.halloween.isActive && !Events.halloween.isHaveGift && !Events.halloween.isItemTryDrop && gameplay.seconds < balance.reward.timeDropEventItem) { Events.halloween.isItemTryDrop = true; if (Random.value > 0.4f) { isBat = true; image.sprite = type.spriteBat; } } else { rikiImage.idle.SetActive(true); } }