Beispiel #1
0
 public BoatController()
 {
     boat       = Object.Instantiate(Resources.Load("Prefabs/boat", typeof(GameObject))) as GameObject;
     boat.name  = "boat";
     movescript = boat.AddComponent(typeof(MoveController)) as MoveController;
     boat.AddComponent(typeof(UserClick));
     boatStatus     = 0;
     frontCharacter = null;
     backCharacter  = null;
 }
Beispiel #2
0
        public ICharacterController(int index, string racing, Vector3 pos)
        {
            string path = "Prefabs/" + racing;

            character      = Object.Instantiate(Resources.Load(path, typeof(GameObject))) as GameObject;
            character.name = racing + index.ToString();
            character.transform.position = pos;
            race   = racing;
            onBoat = false;
            place  = "from";

            movescript = character.AddComponent(typeof(MoveController)) as MoveController;

            userclick = character.AddComponent(typeof(UserClick)) as UserClick;
            userclick.setController(this);
        }