// Use this for initialization
    void Start()
    {
        data                  = gameObject.GetComponent <StarshipData>();
        MaxHealth             = data.totalHitPoints;
        CurrentHealth         = MaxHealth;
        data.currentHitPoints = CurrentHealth;

        healthBarSlider.value = CalculateHealthPercentage();
    }
Exemple #2
0
    public void Initialize(GameObject StarshipPrefab)
    {
        Health                  health                  = StarshipPrefab.GetComponent <Health>();
        Starship_Engine         starship_Engine         = StarshipPrefab.GetComponent <Starship_Engine>();
        Starship_RotationEngine starship_RotationEngine = StarshipPrefab.GetComponent <Starship_RotationEngine>();
        Guns guns = StarshipPrefab.GetComponent <Guns>();

        StarshipData starshipData = StarshipsModificatonsData.GetStarshipData(StarshipPrefab.GetComponent <PlayerStarshipModifications>().Starship);

        InitializeModificationMenu(ModificationMenus[0], health.maxHp, starshipData, ModificationName.Health);
        InitializeModificationMenu(ModificationMenus[1], starship_Engine.force, starshipData, ModificationName.EnginePower);
        InitializeModificationMenu(ModificationMenus[2], starship_RotationEngine.force, starshipData, ModificationName.GyroPower);
        InitializeModificationMenu(ModificationMenus[3], 1 / guns.ShootTime, starshipData, ModificationName.ShootTime);
    }
Exemple #3
0
    public float closeEnoughDistance;     //Buffer for waypoints, so if you're next to waypoint it's "good enough" and you can progess through to the next waypoint

    // Use this for initialization
    void Start()
    {
        data = GetComponent <StarshipData> ();
    }
Exemple #4
0
 private void InitializeModificationMenu(ModificationMenu ModificationMenu, float value, StarshipData StarshipData, ModificationName ModificationName)
 {
     ModificationMenu.Initialize(value, StarshipData.GetModificationData(ModificationName), TryUpgrade, CostEnabledColor, CostDisabledColor);
 }
Exemple #5
0
 // Use this for initialization
 void Start()
 {
     data = gameObject.GetComponent <StarshipData>();
 }