protected override void OnEnable() { isInForeground = ProbabilityUtil.PercentChance(35f); SetSpeeds(); SetScale(); SetLayer(); SetColor(); SetPosition(); }
protected override void OnEnable() { isFromAbove = ProbabilityUtil.PercentChance(50f); base.OnEnable(); GetComponent <SpriteRenderer>().color = Color.white; isMakeSound = ProbabilityUtil.PercentChance(20f); GetComponent <Animator>().enabled = true; GetComponent <SpriteRenderer>().flipY = false; }
private void FlipObject() { if (ProbabilityUtil.PercentChance(50)) { transform.rotation = Quaternion.Euler(0, 180f, 0); isFlipped = true; } else { transform.rotation = Quaternion.Euler(0, 0, 0); isFlipped = false; } }
public void InitializeProbabilities() { bigBranchSmallChild_Probabilites = new ProbabilityUtil(BranchDecay_probabilites); branchNum_Probabilites = new ProbabilityUtil(BranchNum_probabilites); }