コード例 #1
0
ファイル: ModelFactory.cs プロジェクト: ArtReeX/memoria
    public static GameObject CreateDefaultWeaponForCharacterWhenUseAsEnemy(String path)
    {
        Int32      num    = ModelFactory.defaultWeaponTable[path];
        ItemAttack weapon = ff9weap.WeaponData[num];
        String     text   = FF9BattleDB.GEO.GetValue((Int32)weapon.ModelId);

        global::Debug.LogWarning("-------------------------------------------------------------------------");
        return(ModelFactory.CreateModel("BattleMap/BattleModel/battle_weapon/" + text + "/" + text, true));
    }
コード例 #2
0
 internal Weapon(ItemAttack data)
 {
     _data = data;
 }
コード例 #3
0
    void CreateActionButtons()
    {
        GameObject attackButton     = Instantiate(actionButton) as GameObject;
        Text       attackButtonText = attackButton.transform.Find("Text").gameObject.GetComponent <Text>();

        attackButtonText.text = "Attack";
        attackButton.GetComponent <Button>().onClick.AddListener(() => Attack());
        attackButton.transform.SetParent(actionSpacer, false);
        attackButtons.Add(attackButton);

        GameObject skillsButton     = Instantiate(actionButton) as GameObject;
        Text       skillsButtonText = skillsButton.transform.Find("Text").gameObject.GetComponent <Text>();

        skillsButtonText.text = "Skills";
        skillsButton.GetComponent <Button>().onClick.AddListener(() => selectSkill());
        skillsButton.transform.SetParent(actionSpacer, false);
        attackButtons.Add(skillsButton);

        GameObject formsButton     = Instantiate(actionButton) as GameObject;
        Text       formsButtonText = formsButton.transform.Find("Text").gameObject.GetComponent <Text>();

        formsButtonText.text = "Forms";
        formsButton.GetComponent <Button>().onClick.AddListener(() => SelectForm());
        formsButton.transform.SetParent(actionSpacer, false);
        attackButtons.Add(formsButton);

        GameObject itemsButton     = Instantiate(actionButton) as GameObject;
        Text       itemsButtonText = itemsButton.transform.Find("Text").gameObject.GetComponent <Text>();

        itemsButtonText.text = "Items";
        itemsButton.GetComponent <Button>().onClick.AddListener(() => SelectItem());
        itemsButton.transform.SetParent(actionSpacer, false);
        attackButtons.Add(itemsButton);

        GameObject fleeButton     = Instantiate(actionButton) as GameObject;
        Text       fleeButtonText = fleeButton.transform.Find("Text").gameObject.GetComponent <Text>();

        fleeButtonText.text = "Flee";
        fleeButton.GetComponent <Button>().onClick.AddListener(() => Flee());
        fleeButton.transform.SetParent(actionSpacer, false);
        attackButtons.Add(fleeButton);

        GameObject loseButton     = Instantiate(actionButton) as GameObject;
        Text       loseButtonText = loseButton.transform.Find("Text").gameObject.GetComponent <Text>();

        loseButtonText.text = "Lose";
        loseButton.GetComponent <Button>().onClick.AddListener(() => Lose());
        loseButton.transform.SetParent(actionSpacer, false);
        attackButtons.Add(loseButton);

        if (heroManageList[0].GetComponent <PCStateMachine>().playerCharacter.skillList.Count > 0)
        {
            foreach (Attack skill in heroManageList[0].GetComponent <PCStateMachine>().playerCharacter.skillList)
            {
                if (skill.learned)
                {
                    GameObject addSkillButton  = Instantiate(skillButton) as GameObject;
                    Text       skillButtonText = addSkillButton.transform.Find("Text").gameObject.GetComponent <Text>();
                    skillButtonText.text = skill.attackName;
                    SkillAttack sB = skillButton.GetComponent <SkillAttack>();
                    sB.skillToPerform = skill;
                    addSkillButton.transform.SetParent(skillsSpacer, false);
                    attackButtons.Add(addSkillButton);
                }
            }
        }
        else
        {
            skillsButton.GetComponent <Button>().interactable = false;
        }

        if (heroManageList[0].GetComponent <PCStateMachine>().playerCharacter.formList.Count > 0)
        {
            foreach (Form form in heroManageList[0].GetComponent <PCStateMachine>().playerCharacter.formList)
            {
                GameObject addFormButton  = Instantiate(formButton) as GameObject;
                Text       formButtonText = addFormButton.transform.Find("Text").gameObject.GetComponent <Text>();
                formButtonText.text = form.formName;
                FormAttack fB = formButton.GetComponent <FormAttack>();
                fB.formToEnter = form;
                addFormButton.transform.SetParent(formsSpacer, false);
                attackButtons.Add(addFormButton);
            }
        }
        else
        {
            formsButton.GetComponent <Button>().interactable = false;
        }

        if (heroManageList[0].GetComponent <PCStateMachine>().playerCharacter.itemList.Count > 0)
        {
            foreach (Item item in heroManageList[0].GetComponent <PCStateMachine>().playerCharacter.itemList)
            {
                if (item.itemCount > 0)
                {
                    GameObject addItemButton  = Instantiate(itemButton) as GameObject;
                    Text       itemButtonText = addItemButton.transform.Find("Text").gameObject.GetComponent <Text>();
                    itemButtonText.text = item.itemName;
                    ItemAttack iB = itemButton.GetComponent <ItemAttack>();
                    iB.itemToUse = item;
                    addItemButton.transform.SetParent(itemsSpacer, false);
                    attackButtons.Add(addItemButton);
                }
            }
        }
        else
        {
            itemsButton.GetComponent <Button>().interactable = false;
        }
    }
コード例 #4
0
ファイル: Player.cs プロジェクト: parkovski/scifi
 private void Initialize()
 {
     eAttacks    = new Attack[attackCount];
     eItemAttack = new ItemAttack(this, pInputManager, throwItemHoldTime);
     OnInitialize();
 }