private void Awake() { myRigidbody = GetComponent <Rigidbody>(); pressToGetShellUI = Instantiate(ConstantsManager.PressToGetShellUIPrefab); currentShellStats = baseShellStats; currentHealth = ConstantsManager.BaseCrabLife; IsAlive = true; }
private static void initializeShellStats() { shellBaseStats = new ShellStats(); shellBaseStats.damage = 15; shellBaseStats.speed = 30; shellBaseStats.penetrations = upgrades.penetration_lvl; shellBaseStats.bounces = upgrades.bounce_lvl; }
private void SetupShell(ShellStats stats) { List <Transform> modelContainerChildren = new List <Transform>(); for (int i = 0; i < modelContainer.childCount; i++) { modelContainerChildren.Add(modelContainer.GetChild(i)); } for (int i = 0; i < modelContainerChildren.Count; i++) { Destroy(modelContainerChildren[i].gameObject); } Transform newShell = Instantiate(stats.ModelPrefab, modelContainer); animator = newShell.GetComponentInChildren <Animator>(); currentShellStats = stats; currentShellHealth = stats.ShellHealth; shellValue.SetValue(currentShellHealth > 0 ? 1 : 0); ApplyBaseMaterial(); }