Ejemplo n.º 1
0
    private void createMainPlayer()
    {
        string        name = "__Player_main__";
        Player_Entity p    = makePlayer(name);

        mainPlayer = p;
    }
Ejemplo n.º 2
0
    private int addMultiPlayer()
    {
        int           index = multiPlayers.Count;
        string        name  = "__MultiPlayer_" + index + "__";
        Player_Entity p     = makePlayer(name);

        multiPlayers.Add(p);
        return(index);
    }
Ejemplo n.º 3
0
    private Player_Entity makePlayer(string name)
    {
        Actor_Data    data   = new Actor_Data(); //creates new random Actor_Data
        Actor_Entity  actor  = Actor_Manager.singleton.createActorEntity(name);
        Player_Entity player = new Player_Entity(actor);

        player.playerController = player.GO.AddComponent <Player_Controller>();

        player.actorController.actorData                  = data;
        player.actorController.actorData.name             = name;
        player.actorController.actorData.breedData.gender = Actor_Gender.male;
        player.actorController.actorData.ageInSecondsMax  = ulong.MaxValue - 1;
        player.actorController.actorData.essential        = true;

        //GameObject debugActorTMP = Instantiate((GameObject)Resources.Load("Debug/Debug_Actor"));
        //debugActorTMP.transform.SetParent(player.playerGO.gameObject.transform);

        player.GO.transform.position = new Vector3(Random.Range(10.0f, 20.0f), 0.0f, Random.Range(10.0f, 20.0f));

        DontDestroyOnLoad(player.GO);

        return(player);
    }