Esempio n. 1
0
    // =============================================================================
    // METHODS UNITY ---------------------------------------------------------------
    protected virtual void Awake()
    {
        base.Awake ();
        //dan
        Button = new InteractionKey(InteractionKey.MouseKey.Left, "[7]", "A", "");
        Button.Initialize ();

        Coll = collider;
    }
Esempio n. 2
0
    // =============================================================================
    // METHODS UNITY ---------------------------------------------------------------

    protected virtual void Awake()
    {
        base.Awake();
//dan
        Button = new InteractionKey(InteractionKey.MouseKey.Left, "[7]", "A", "");
        Button.Initialize();

        Coll = collider;
    }
Esempio n. 3
0
    // =============================================================================



    // =============================================================================
    // METHODS UNITY ---------------------------------------------------------------


    /* Initialisierung der Objekte ButtonStart, ButtonReset und ButtonStop.
     * Der GameController GameController wird auf Instance gesetzt.
     * Die Variable LastState wird auf den Status von GameController gesetzt, welcher beim Start der Klasse aktiv ist.
     */
    void Awake()
    {
        Config = GameObject.FindWithTag("Config").GetComponent <Config> ();

        NetView = networkView;
//dan

        Debug.Log(">>>>>PlayerInteractionGame_Awake");
        GameController = GameController.Instance;
        LastState      = GameController.GetState();

        ButtonStart = new InteractionKey(InteractionKey.MouseKey.Right, "[0]", "START", "(1)");
        ButtonStart.Initialize();
        ButtonReset = new InteractionKey(InteractionKey.MouseKey.None, "[0]", "START", "(1)");
        ButtonReset.Initialize();
        ButtonStop = new InteractionKey(InteractionKey.MouseKey.None, "[1]", "BACK", "(2)");
        ButtonStop.Initialize();
    }
Esempio n. 4
0
    // =============================================================================
    // =============================================================================
    // METHODS UNITY ---------------------------------------------------------------
    /* Initialisierung der Objekte ButtonStart, ButtonReset und ButtonStop.
     * Der GameController GameController wird auf Instance gesetzt.
     * Die Variable LastState wird auf den Status von GameController gesetzt, welcher beim Start der Klasse aktiv ist.
     */
    void Awake()
    {
        Config = GameObject.FindWithTag ( "Config" ).GetComponent<Config> ();

        NetView = networkView;
        //dan

        Debug.Log(">>>>>PlayerInteractionGame_Awake");
        GameController = GameController.Instance;
        LastState = GameController.GetState ();

        ButtonStart = new InteractionKey(InteractionKey.MouseKey.Right, "[0]", "START" , "(1)");
        ButtonStart.Initialize ();
        ButtonReset = new InteractionKey(InteractionKey.MouseKey.None, "[0]", "START" , "(1)");
        ButtonReset.Initialize ();
        ButtonStop = new InteractionKey(InteractionKey.MouseKey.None, "[1]", "BACK" , "(2)");
        ButtonStop.Initialize ();
    }
    private void Update()
    {
        if (this.currentPlanet != null)
        {
            this.infoText.setGuiText(this.currentPlanet.planetResource.count, this.currentPlanet.planetName);
        }

        if (this.planetAgent != null)
        {
            if (Input.GetKey(KeyCode.E))
            {
                currentKeyPress = InteractionKey.CONQUER;
                this.planetAgent.conquer(OwnedByPlayer.PLAYER_1, Time.deltaTime);
            }
        }

        if (!Input.GetKey(KeyCode.E) && currentKeyPress == InteractionKey.CONQUER)
        {
            currentKeyPress = InteractionKey.NOTHING;
            abortConquering();
        }
    }