Exemplo n.º 1
0
 private void Awake()
 {
     myRigidbody       = GetComponent <Rigidbody>();
     pressToGetShellUI = Instantiate(ConstantsManager.PressToGetShellUIPrefab);
     currentShellStats = baseShellStats;
     currentHealth     = ConstantsManager.BaseCrabLife;
     IsAlive           = true;
 }
Exemplo n.º 2
0
 private static void initializeShellStats()
 {
     shellBaseStats              = new ShellStats();
     shellBaseStats.damage       = 15;
     shellBaseStats.speed        = 30;
     shellBaseStats.penetrations = upgrades.penetration_lvl;
     shellBaseStats.bounces      = upgrades.bounce_lvl;
 }
Exemplo n.º 3
0
    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();
    }