unity3d - Unity saying "the associated script is not valid" for the default scripts -


i working on project , got point when had write first script. when wrote it, every other script in unity stopped working.

it says

"the associated script cannot loaded, please fix compile errors , assign valid script.".

i have not edited of other scripts, should work , when import them in project work. can't start on because have put weeks worth of work , if start on won't guarantee won't happen again.

here script

#pragma strict  function start () {     private var doorisopen:boolean=false;     private var doortimer:float=0.0;     private var currentdoor:gameobject;     public var dooropentime:float=3.0;     public var dooropensound:audioclip;     public var doorshutsound:audioclip;  }  function update () {     if(dooropen){          doortimer+=time.deltatime;         if(doortimer>dooropentime){         door(doorshutsound,false,"doorshut",currentdoor);     }         doortimer = 0.0;      }       }   } function door(aclip : audioclip ,opencheck : boolean, animname : string, thisdoor : gameobject ){     audio.playoneshot(aclip);     doorisopen = opencheck;     thisdoor.transform.parent.animation.play(animname);  }  //function opendoor(){     //audio.playoneshot(dooropensound)     //var myoutpost:gameobject = gameobject.find("outpost");     //myoutpost.animation.play("dooropen");   } function oncontrollercolliderhit(hit:controllercolliderhit){     if(hit.gameobject.tag == "outpostdoor" && doorisopen = false){           currentdoor = hit.gameobject;         door(dooropensound,true,"dooropen",currentdoor);         dooropen = true;      } }  //function shutdoor(){     //audio.playoneshot(doorshutsound)     //doorisopen = false;      //var myoutpost:gameobject = gameobject.find("outpost");     //myoutpost.animation.play("doorshut");   }  @script requirecomponent(audiosource) 

the reason seeing non-edited scripts cannot compiled , loaded because of errors in new script. have make new script compiler-friendly.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -