i need scrptt for tycoon project i need 1 main scriptt and 1 scriptt on tycoon objects i…
- User
i need scrptt for tycoon project
i need 1 main scriptt and 1 scriptt on tycoon objects
i need userr was having in main scriptt button, with cliks he get currency on that he able to buy tycoon objects
also triggerr must be conencted with objectt, for it i need gizmoo disactivating and activating object must have anothe scriptt that have only public int id and onenable distactivate
so, onenable every obejct with tycoon scriptt must be desabled, also its scriptt must have tmproo text vareiable, so there will be price of object also triggerr tycoon obejct scriptt must have also int for connecting with obejcts int, so they know what obejct need be activatedd if enough currency
also main thin if enough moneys on tycoon trigerr sciprtt then - spawned obejct must actrive true and i need near 1 second varible coroutin must move activating obejct its must teleport obejct to triggerr box coliderr, and give it scale 0 0 0 and then slowly revert it to obejct normal scale and its previous normal position like before entering tycoon trigge
- Assistant
- User
how TycoonTrigger and TycoonObject if finding each otherr? in scene there many TycoonTrigger and tycoon obejcts, but obejctsId only 1 and special
is it works? i need short answerr
- Assistant
- User
// Find the TycoonObject with the matching ID TycoonObject[] tycoonObjects = FindObjectsOfType(); foreach (TycoonObject tycoonObject in tycoonObjects) { if (tycoonObject.id == objectId && !tycoonObject.gameObject.activeInHierarchy) { tycoonObject.Activate(); break; } }
what if i have near 100 tycoon obejcts, is wil impact on perfomance? every time callinmg TycoonObject[] tycoonObjects = FindObjectsOfType();
right?
- Assistant