コード例 #1
0
ファイル: Player.cs プロジェクト: TommasoBianchi/GGJ2019
 private void Awake()
 {
     myRigidbody       = GetComponent <Rigidbody>();
     pressToGetShellUI = Instantiate(ConstantsManager.PressToGetShellUIPrefab);
     currentShellStats = baseShellStats;
     currentHealth     = ConstantsManager.BaseCrabLife;
     IsAlive           = true;
 }
コード例 #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;
 }
コード例 #3
0
ファイル: Player.cs プロジェクト: TommasoBianchi/GGJ2019
    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();
    }