Start() private méthode

private Start ( ) : IEnumerator
Résultat IEnumerator
Exemple #1
0
    // Use this for initialization
    protected virtual void OnEnable()
    {
        DialogueManager manager = DialogueManager.LoadDialogueFile(dialogFile);

        currentDialogue = manager.GetDialogue(dialogName);
        currentDialogue.Start();
        Dialogue.Choice[] choices = currentDialogue.GetChoices();
        Debug.Log(choices.Length);
        if (choices.Length > 0)
        {
            if (choices.Length == 1)
            {
                currentChoice = choices[0];
                currentDialogue.PickChoice(currentChoice);
                nextChoices = currentDialogue.GetChoices();
            }
            else
            {
                currentChoice = null;
                nextChoices   = choices;
            }
            LevelManager.Instance().clickLocked = true;
            SetupDialogueBox();

            this.gameObject.SetActive(false);
        }
    }
Exemple #2
0
    void InitStuff()
    {
        Items.Start();
        Jobs.Start();
        Dialogue.Start();
        World.Start();

        // Create the quest marker
        questMarker = Instantiate(questMarker) as GameObject;

        // Create the textbox
        textbox     = Instantiate(textbox, new Vector3(4.5f, 0.5f, 0f), Quaternion.identity) as GameObject;
        textManager = textbox.GetComponent <Textbox>();
        textManager.Draw();

        // Create the inventory box
        inventory        = Instantiate(inventory, new Vector3(0f, 0f, 0f), Quaternion.identity) as GameObject;
        inventoryManager = inventory.GetComponent <Inventory>();
        inventoryManager.Setup();

        // Create the info box
        GameObject textContainer = new GameObject();

        textContainer = Instantiate(textContainer, new Vector3(6f, 9.5f, -1f), Quaternion.identity) as GameObject;
        textContainer.AddComponent <TextMesh>();
        Vector3 oldScale = textContainer.transform.localScale;
        Vector3 newScale = new Vector3(oldScale.x * .25f, oldScale.y * .25f, oldScale.z * .25f);

        textContainer.transform.localScale = newScale;
        textMesh           = textContainer.GetComponent <TextMesh>();
        textMesh.alignment = TextAlignment.Left;
        textMesh.color     = Color.white;
        textMesh.fontSize  = 20;
    }
Exemple #3
0
 public void Update(GameTime gameTime)
 {
     if (Vector2.DistanceSquared(Player.collision.Position, Position) < 800)
     {
         ShowInteractIcon = true;
         var kstate = Keyboard.GetState();
         if (kstate.IsKeyDown(Keys.E))
         {
             Dialogue.Start(dialogueSequence);
             //Taken = true;
         }
     }
     else
     {
         ShowInteractIcon = false;
     }
 }
Exemple #4
0
    // Initializes the game
    void InitGame()
    {
        Items.Start();
        Jobs.Start();
        Dialogue.Start();

        // Draw the textbox
        textbox     = Instantiate(textbox, new Vector3(4.5f, 0.5f, 0f), Quaternion.identity) as GameObject;
        textManager = textbox.GetComponent <Textbox>();
        textManager.Draw();

        // Create the map
        map                = Instantiate(map, new Vector3(5.5f, 5.5f, 0), Quaternion.identity) as GameObject;
        mapManager         = map.GetComponent <MapManager>();
        mapManager.textbox = textManager;
        mapManager.SetupScene();

        // Where are we on the map?
        int     mapX = Random.Range(0, 10);
        int     mapY = Random.Range(0, 10);
        Vector3 tile = mapManager.map[mapX][mapY].EmptyLocation();

        while (tile.x == -1)
        {
            tile = mapManager.map[mapX][mapY].EmptyLocation();
        }

        // Create the player
        player                = Instantiate(player, new Vector3(tile.x, tile.y, 10f), Quaternion.identity) as GameObject;
        playerManager         = player.GetComponent <Player>();
        playerManager.map     = mapManager;
        playerManager.textbox = textManager;
        playerManager.PlaceAt(mapX, mapY, (int)tile.x, (int)tile.y, (int)(10 - tile.y));

        // Draw our area on the map
        mapManager.player = playerManager;
        mapManager.Draw(playerManager.mapX, playerManager.mapY);
    }
Exemple #5
0
    // Use this for initialization
    protected virtual void OnEnable()
    {
        DialogueManager manager = DialogueManager.LoadDialogueFile(dialogFile);
        currentDialogue = manager.GetDialogue(dialogName);
        currentDialogue.Start();
        Dialogue.Choice[] choices = currentDialogue.GetChoices();
        Debug.Log(choices.Length);
        if(choices.Length > 0 ){
            if(choices.Length == 1) {
                currentChoice = choices[0];
                currentDialogue.PickChoice(currentChoice);
                nextChoices = currentDialogue.GetChoices();
            }
            else {
                currentChoice = null;
                nextChoices = choices;
            }
            LevelManager.Instance().clickLocked = true;
            SetupDialogueBox();

            this.gameObject.SetActive(false);
        }
    }