Exemplo n.º 1
0
 void DrawModel()
 {
     if (subStep == 0)
     {
         DrawText("In order to replace the human model in one of the bots prefabs, you need a Humanoid rigged model.\n \n" +
                  "your model has to be set up in <b>Humanoid</b> rigged in the model import settings:");
         Space(2);
         DrawImage(GetServerImage(0));
         DownArrow();
         DrawText("Then, drag the player model in the empty field bellow and click on <b>Create</b> button");
         Space(2);
         GUILayout.BeginVertical("box");
         ModelPrefab = EditorGUILayout.ObjectField("Human Model", ModelPrefab, typeof(GameObject), true) as GameObject;
         if (ModelPrefab != null)
         {
             Space(4);
             if (DrawButton("Create"))
             {
                 ReplaceBotModel();
                 NextStep();
             }
         }
         GUILayout.EndVertical();
     }
     else if (subStep == 1)
     {
         DrawText("Ok, now if all work correctly you should see a prefab in the scene hierarchy called <b>AISoldier [NEW]</b> with your human model integrated, that's the bot prefab," +
                  "your model has been integrated and setup automatically, even though there is a fix that you have to do manually, the weapons model has been move to the new model right hand transform " +
                  "but the position of these could be wrong, so you have to positioned it right.");
         DrawImage(GetServerImage(1));
         DrawText("for it you have to select the weapon parent transform, click in the button bellow to select it automatically.");
         Space(2);
         if (DrawButton("Select bot weapons parent"))
         {
             bl_AIShooterWeapon asw = FindObjectOfType <bl_AIShooterWeapon>();
             Transform          wr  = asw.m_AIWeapons[0].WeaponObject.transform.parent;
             Selection.activeTransform = wr;
             EditorGUIUtility.PingObject(wr);
         }
         DownArrow();
         DrawText("Now positioned the weapons (moving the selected transform) to simulate that the human models is holding it:");
         DrawImage(GetServerImage(2));
     }
     else if (subStep == 2)
     {
         DrawText("Good, all is ready, now you have to create a prefab of this or replace one of the current bots prefabs," +
                  "for it drag the <b>AISoldier [NEW]</b> from hierarchy to a <b>Resources</b> folder, for default you can drag it to <i>MFPS -> Resources</i>, in this folder you can create a prefab" +
                  " or replace one of the default bots prefabs (AISoldier or AISoldier2), in case you create a new prefab you also have to assign this prefab in GameData -> BotTeam1 or BotTeam2.");
         DrawImage(GetServerImage(3));
         DrawText("That's :)");
     }
 }
 /// <summary>
 ///
 /// </summary>
 protected override void Awake()
 {
     base.Awake();
     m_Transform = transform;
     bl_PhotonCallbacks.PlayerEnteredRoom += OnPhotonPlayerConnected;
     bl_AIMananger.OnBotStatUpdate        += OnBotStatUpdate;
     Agent                 = this.GetComponent <NavMeshAgent>();
     AIAnim                = GetComponentInChildren <bl_AIAnimation>();
     AIHealth              = GetComponent <bl_AIShooterHealth>();
     AIWeapon              = GetComponent <bl_AIShooterWeapon>();
     defaultSpeed          = Agent.speed;
     Anim                  = GetComponentInChildren <Animator>();
     ObstacleBetweenTarget = false;
     CoverManager          = FindObjectOfType <bl_AICovertPointManager>();
     AIManager             = CoverManager.GetComponent <bl_AIMananger>();
     TimeManager           = FindObjectOfType <bl_RoundTime>();
     DrawName              = GetComponent <bl_DrawName>();
     m_GameMode            = GetGameMode;
 }