public Boat_model() { flag = 1; from_pos = new Vector3[] { new Vector3(4.5f, 1.5f, 0), new Vector3(5.5f, 1.5f, 0) }; to_pos = new Vector3[] { new Vector3(-5.5f, 1.5f, 0), new Vector3(-4.5f, 1.5f, 0) }; boat = Object.Instantiate(Resources.Load("Prefabs/boat", typeof(GameObject)), fromPos, Quaternion.identity, null) as GameObject; boat.name = "boat"; Cmove = boat.AddComponent(typeof(Move_model)) as Move_model; boat.AddComponent(typeof(ClickGUI)); }
public Character_model(string Myname) { if (Myname == "priest") { character = Object.Instantiate(Resources.Load("Prefabs/priest", typeof(GameObject)), new Vector3(6, 0, 0), Quaternion.identity, null) as GameObject; Ctype = 0; } else { character = Object.Instantiate(Resources.Load("Prefabs/devil", typeof(GameObject)), new Vector3(6, 0, 0), Quaternion.identity, null) as GameObject; Ctype = 1; } Cmove = character.AddComponent(typeof(Move_model)) as Move_model; clickgui = character.AddComponent(typeof(ClickGUI)) as ClickGUI; clickgui.setController(this); }