void Start()
 {
     composableVisibility = GetComponent<ComposableVisibility>();
     playerUpgrades = PlayerUpgrades.instance;
     playerUpgrades.PlayerUgradeBought += UpdateGameObjectState;
     playerUpgrades.OnLoad(UpdateGameObjectState);
     changeVisibilityWhenPlacingTiles = GetComponent<ChangeVisibilityWhenPlacingTiles>();
 }
Example #2
0
        private static Sisco_Return onGameSaved(ref object sender, ref object[] args, ref object return_value)
        {
            string gameName         = (string)args[0];
            string plyUpgradesFile  = String.Concat(gameName, ".pug");
            string plotUpgradesFile = String.Concat(gameName, ".plu");

            SLog.Debug("Writing: {0}", plyUpgradesFile);
            SLog.Debug("Writing: {0}", plotUpgradesFile);

            // SAVE PLAYER UPGRADES
            // Always write to a temp file first when saving data
            string        tmpFile       = String.Concat(plyUpgradesFile, ".tmp");
            List <string> upgrades_list = new List <string>(Player_Upgrades_Missing);

            upgrades_list.AddRange(PlayerUpgrades.Select(o => o.ID).ToArray());

            File.WriteAllText(tmpFile, String.Join("\n", upgrades_list.Distinct(StringComparer.OrdinalIgnoreCase).ToArray()));
            File.Copy(tmpFile, plyUpgradesFile, true);
            File.Delete(tmpFile);

            // SAVE PLOT UPGRADES
            Save_Plot_Upgrades(plotUpgradesFile);
            return(null);
        }
Example #3
0
 // Start is called before the first frame update
 void Start()
 {
     playerUpgrades = PlayerUpgrades.instance;
     playerManager  = PlayerManager.Instance;
     playerManager.onStatsChangeCallback += UpdateUI;
 }
 void Start()
 {
     playerUpgrades = levelPanel.GetComponent <PlayerUpgrades>();
     StartLevel();
 }
Example #5
0
 private void Start()
 {
     upgrades = PlayerUpgrades.instance;
     InvokeRepeating("decreaseStats", loopTime, loopTime);  //1s delay, repeat every 1s
 }
 void Start()
 {
     playerUpgrades = PlayerUpgrades.instance;
 }
Example #7
0
	// Use this for initialization
	void Start () {
		attribute_collection = new List<GameObject> ();
		pu = GetComponent<PlayerUpgrades> ();
	    displayer = GameObject.Find("Canvas").GetComponent<AttributeDisplayer>();
	}
 void Awake() {
     instance = this;
 }
Example #9
0
 private void Start()
 {
     interfaceController = GameObject.FindGameObjectWithTag("UIController").GetComponent <InterfaceController>();
     _waveController     = GameObject.FindGameObjectWithTag("EnemyParent").GetComponent <WaveController>();
     playerUpgrades      = GetComponent <PlayerUpgrades>();
 }
Example #10
0
 private void Awake()
 {
     player         = PlayerFinder.Find("Player");
     playerUpgrades = player.GetComponent <PlayerUpgrades>();
     health         = player.GetComponent <Health>();
 }