Example #1
0
        public Boat()
        {
            to_or_from     = 1;
            from_positions = new Vector3[] { new Vector3(4.5F, 1.5F, 0), new Vector3(5.5F, 1.5F, 0) };
            to_positions   = new Vector3[] { new Vector3(-5.5F, 1.5F, 0), new Vector3(-4.5F, 1.5F, 0) };

            boat       = UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Boat", typeof(GameObject)), fromPosition, Quaternion.identity, null) as GameObject;
            boat.name  = "boat";
            moveScript = boat.AddComponent(typeof(MoveBehaviour)) as MoveBehaviour;
            boat.AddComponent(typeof(ClickBehaviour));
        }
Example #2
0
 public Character(string character_type)
 {
     if (character_type == "Priest")
     {
         character     = UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Priest", typeof(GameObject)), Vector3.zero, Quaternion.identity, null) as GameObject;
         characterType = 0;
     }
     else
     {
         character     = UnityEngine.Object.Instantiate(Resources.Load("Prefabs/Devil", typeof(GameObject)), Vector3.zero, Quaternion.identity, null) as GameObject;
         characterType = 1;
     }
     moveScript     = character.AddComponent(typeof(MoveBehaviour)) as MoveBehaviour;
     clickBehaviour = character.AddComponent(typeof(ClickBehaviour)) as ClickBehaviour;
     clickBehaviour.setCharacter(this);
 }