Пример #1
0
        public BoatController(Vector3 frompos, Vector3 topos)
        {
            to_or_from     = BoatState.From;
            fromPosition   = frompos;
            toPosition     = topos;
            from_positions = new Vector3[] { new Vector3(frompos.x - 0.5f, frompos.y + 0.5f, 0), new Vector3(frompos.x + 0.5f, frompos.y + 0.5f, 0) };
            to_positions   = new Vector3[] { new Vector3(topos.x - 0.5f, topos.y + 0.5F, 0), new Vector3(topos.x + 0.5f, topos.y + 0.5F, 0) };

            boat      = Object.Instantiate(Resources.Load("Perfabs/Boat", typeof(GameObject)), fromPosition, Quaternion.identity, null) as GameObject;
            boat.name = "boat";

            move = boat.AddComponent(typeof(Movable)) as Movable;
            boat.AddComponent(typeof(ClickGui));
        }
Пример #2
0
 public MyCharacterController(CharacterType _type)
 {
     if (_type == CharacterType.Priest)
     {
         character      = Object.Instantiate(Resources.Load("Perfabs/Priest", typeof(GameObject)), Vector3.zero, Quaternion.identity, null) as GameObject;
         character.name = "priest";
         type           = _type;
     }
     else
     {
         character      = Object.Instantiate(Resources.Load("Perfabs/Devil", typeof(GameObject)), Vector3.zero, Quaternion.identity, null) as GameObject;
         character.name = "devil";
         type           = _type;
     }
     move     = character.AddComponent(typeof(Movable)) as Movable;
     clickGui = character.AddComponent(typeof(ClickGui)) as ClickGui;
     clickGui.setController(this);
     pos = CharacterPosition.From;
 }