void Start() { winSFX = GetComponent <AudioSource>(); winPointCounter = FindObjectOfType <WinPointCounter>(); originalTrophyPosition = this.transform.position; originalTrophyRotation = this.transform.rotation; }
//vvv SAVE vvv public static void SaveWinPoints(WinPointCounter winPointCounter) { BinaryFormatter formatter = new BinaryFormatter(); string path = Application.persistentDataPath + "/winPoints.save"; FileStream stream = new FileStream(path, FileMode.Create); WinPointData data = new WinPointData(winPointCounter); formatter.Serialize(stream, data); stream.Close(); }
void Start() { towers = FindObjectsOfType <TowerMover>(); supports = FindObjectsOfType <DefenseSupportMover>(); enemySpawner = FindObjectOfType <EnemySpawner>(); loseSFX = GetComponent <AudioSource>(); slowEffects = FindObjectsOfType <SlowEffect>(); winPointCounter = FindObjectOfType <WinPointCounter>(); defensesStore = FindObjectOfType <DefensesStore>(); defenseHover = FindObjectOfType <DefenseHoverOutliner>(); moveViewRot = menuViewRot; foreach (GameObject level in levels) { levelScores.Add(0); } }
public WinPointData(WinPointCounter winPointCounter) { winPoints = winPointCounter.winPoints; purchaseUnlockCost = winPointCounter.purchaseUnlockCost; }
private void Start() { winPointCounter = FindObjectOfType <WinPointCounter>(); defensesStore = FindObjectOfType <DefensesStore>(); loadManager = FindObjectOfType <LoadManager>(); }