Example #1
0
    // data this model uses
    //private ProtoCharacterData m_data;
    //public ProtoCharacterData GetData() {
    //    return m_data;
    //}

    //////////////////////////////////////////
    /// Awake()
    //////////////////////////////////////////
    void Awake()
    {
        // init data asap
        if (Name == "Goblin")
        {
            ProtoCharacterData data = IDL_ProtoCharacters.GetCharacter(Name);

            // set various things
            SetProperty("HP", data.HP);
            SetProperty("Abilities", data.Abilities);
            SetProperty("Name", data.Name);
        }
        else
        {
            // load the player's data
            PlayerData data = PlayerLoader.LoadPlayer();

            SetProperty("HP", data.GetMaxHP());
            SetProperty("Name", data.Name);
            SetProperty("Abilities", data.GetAbilities());
        }

        SetProperty("Effects", new Dictionary <string, Effect>());

        // listen for messages
        ListenForMessages(true);
    }
Example #2
0
    //////////////////////////////////////////
    /// Init()
    /// Inits this UI with the incoming
    /// character data.
    public override void Init(ProtoCharacterData i_data) {
        base.Init( i_data );

        // create ability views
        for (int i = 0; i < AbilityViews.Count; ++i) {
            AbilityViews[i].Init(i_data.Abilities[i]);
        }        
    }
Example #3
0
    //////////////////////////////////////////
    /// Init()
    /// Inits this UI with the incoming
    /// character data.
    //////////////////////////////////////////
    public virtual void Init( ProtoCharacterData i_data ) {
        m_dataCharacter = i_data;

        // set labels
        m_textName.text = i_data.Name;

        // listen for messages
        ListenForMessages( true );
    }
Example #4
0
    //////////////////////////////////////////
    /// Init()
    /// Inits this UI with the incoming
    /// character data.
    public override void Init(ProtoCharacterData i_data)
    {
        base.Init(i_data);

        // create ability views
        for (int i = 0; i < AbilityViews.Count; ++i)
        {
            AbilityViews[i].Init(i_data.Abilities[i]);
        }
    }
Example #5
0
    //////////////////////////////////////////
    /// Init()
    /// Inits this UI with the incoming
    /// character data.
    //////////////////////////////////////////
    public virtual void Init(ProtoCharacterData i_data)
    {
        m_dataCharacter = i_data;

        // set labels
        m_textName.text = i_data.Name;

        // listen for messages
        ListenForMessages(true);
    }
Example #6
0
    //////////////////////////////////////////
    /// SetActiveCharacter()
    /// Sets the active character to the
    /// incoming type.
    //////////////////////////////////////////
    private void SetActiveCharacter(CharacterTypes i_eType)
    {
        // make sure the active character isn't being set numerous times in a row
        if (m_eActiveCharacter == i_eType)
        {
            Debug.LogError("Warning, character getting set to current twice: " + i_eType);
            return;
        }

        // set the active char
        m_eActiveCharacter    = i_eType;
        m_dataActiveCharacter = GameBoard_Chain.Instance.GetDataFromType(i_eType);
    }
Example #7
0
    //////////////////////////////////////////
    /// Init()
    /// Inits this UI with the incoming
    /// character data.
    //////////////////////////////////////////
    public override void Init( ProtoCharacterData i_data ) {
        base.Init( i_data );

        // create ability views
        for ( int i = 0; i < i_data.Abilities.Count; ++i ) {
            // add the view object
            GameObject goView = Instantiate<GameObject>( AbilityPrefab );
            goView.transform.SetParent( AbilityContent.transform );

            // init the view
            AbilityView_Chain view = goView.GetComponent<AbilityView_Chain>();
            view.Init( i_data.Abilities[i] );
        }
    }
Example #8
0
    //////////////////////////////////////////
    /// Init()
    /// Inits this UI with the incoming
    /// character data.
    //////////////////////////////////////////
    public override void Init(ProtoCharacterData i_data)
    {
        base.Init(i_data);

        // create ability views
        for (int i = 0; i < i_data.Abilities.Count; ++i)
        {
            // add the view object
            GameObject goView = Instantiate <GameObject>(AbilityPrefab);
            goView.transform.SetParent(AbilityContent.transform);

            // init the view
            AbilityView_Chain view = goView.GetComponent <AbilityView_Chain>();
            view.Init(i_data.Abilities[i]);
        }
    }
Example #9
0
    //////////////////////////////////////////
    /// SetUpCharacters()
    //////////////////////////////////////////
    private void SetUpCharacters()
    {
        // set the player and monster views
        ProtoCharacterData charPlayer = IDL_ProtoCharacters.GetCharacter("Finthis");
        CharacterView      viewPlayer = GetViewFromType(CharacterTypes.Player);

        viewPlayer.Init(charPlayer);

        ProtoCharacterData charMonster = IDL_ProtoCharacters.GetCharacter("Goblin");
        CharacterView      viewMonster = GetViewFromType(CharacterTypes.AI);

        viewMonster.Init(charMonster);

        // add the data to our list
        m_listData.Add(charPlayer);
        m_listData.Add(charMonster);
    }
Example #10
0
    //////////////////////////////////////////
    /// SetUpCharacters()
    //////////////////////////////////////////
    private void SetUpCharacters()
    {
        // set the player and monster views
        // TODO: Load from player data!
        ProtoCharacterData charPlayer = IDL_ProtoCharacters.GetCharacter("Finthis");
        CharacterView      viewPlayer = GetViewFromType(CharacterTypes.Player);

        viewPlayer.Init(charPlayer);

        ProtoCharacterData charMonster = IDL_ProtoCharacters.GetCharacter("Goblin");
        CharacterView      viewMonster = GetViewFromType(CharacterTypes.AI);

        viewMonster.Init(charMonster);

        // add the data to our list
        m_listData.Add(charPlayer);
        m_listData.Add(charMonster);

        // let the game know characters have been set up
        Messenger.Broadcast("CharactersSetUp");
    }
 //////////////////////////////////////////
 /// Init()
 /// Inits this UI with the incoming
 /// character data.
 //////////////////////////////////////////
 public override void Init( ProtoCharacterData i_data ) {
     base.Init( i_data );
 }
Example #12
0
 //////////////////////////////////////////
 /// Init()
 /// Inits this UI with the incoming
 /// character data.
 //////////////////////////////////////////
 public override void Init(ProtoCharacterData i_data)
 {
     base.Init(i_data);
 }