Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

Get String Between Two Characters

$
0
0
So I'm making mods in my game and everything's fine, but the only thing is that you would have to make multiple scripts for multiple inputs because right now it only detects if it has something like input.keyPress. I need to be able to have it where it can be input.keyPress{DETECT STUFF INSIDE HERE} and then inside of there it would have functions that I've coded into the mods like instantiating and ect. Sorry if this question doesn't make sense, if it doesn't I'll try to rephrase it. Thanks! :D I use JS but I can translate C#, I've been using Unity for a year or two. The code may not make sense because I have probably around a hundred scripts all reacting with each other but just in case here's the code. #pragma strict import System.IO; private var allObjects:GameObject[]; var chars:KeyCode[]; var contents:String[]; private var mods:String[]; private var spawns:GameObject[]; function Start(){ var di=new DirectoryInfo(Application.dataPath+"/Mods"); mods=Directory.GetFiles(Application.dataPath+"/Mods", "*.drmod"); spawns=ClientControls.cc.spawnItems; if(di.Exists==false){ di.Create(); } yield; for(var mod=0; mod

Viewing all articles
Browse latest Browse all 1875

Trending Articles