Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        masterList          = GameObject.Find("MasterList").GetComponent <masterListController>();
        partyInventory      = GameObject.Find("partyInventory");
        inventoryController = GameObject.Find("gameController").GetComponent <inventoryController>();

        if (mainWeapon)
        {
            mainWeapon    = findInInventory(mainWeapon.name);
            totalDefense += mainWeapon.GetComponent <itemData>().defense;
            totalAttack  += mainWeapon.GetComponent <itemData>().damage;
        }
        if (subWeapon)
        {
            subWeapon     = findInInventory(subWeapon.name);
            totalDefense += subWeapon.GetComponent <itemData>().defense;
            totalAttack  += subWeapon.GetComponent <itemData>().damage;
        }
        if (head)
        {
            head          = findInInventory(head.name);
            totalDefense += head.GetComponent <itemData>().defense;
            totalAttack  += head.GetComponent <itemData>().damage;
        }
        if (chest)
        {
            chest         = findInInventory(chest.name);
            totalDefense += chest.GetComponent <itemData>().defense;
            totalAttack  += chest.GetComponent <itemData>().damage;
        }
        if (hands)
        {
            hands         = findInInventory(hands.name);
            totalDefense += hands.GetComponent <itemData>().defense;
            totalAttack  += hands.GetComponent <itemData>().damage;
        }
        if (legs)
        {
            legs          = findInInventory(legs.name);
            totalDefense += legs.GetComponent <itemData>().defense;
            totalAttack  += legs.GetComponent <itemData>().damage;
        }
        if (feet)
        {
            feet          = findInInventory(feet.name);
            totalDefense += feet.GetComponent <itemData>().defense;
            totalAttack  += feet.GetComponent <itemData>().damage;
        }
        if (accessory)
        {
            accessory     = findInInventory(accessory.name);
            totalDefense += accessory.GetComponent <itemData>().defense;
            totalAttack  += accessory.GetComponent <itemData>().damage;
        }
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
//		data = GameObject.FindGameObjectWithTag("data").GetComponent<dataContainer>();
        masterList        = GetComponentInChildren <masterListController>();
        timeController    = GameObject.Find("TimeController").GetComponent <timeController>();
        weatherController = GetComponent <weatherController>();
        cameraController  = GameObject.Find("Camera").GetComponent <cameraController>();
        mapController     = GetComponent <mapController>();
        battleController  = GetComponent <battleController>();
        currentParty      = new GameObject[maxPartySize];
        loadCharas();
//		playerController = GameObject.FindGameObjectWithTag("Player").GetComponent<playerController>();
//		inventoryController = GetComponent<inventoryController>();
//		loadInventory();
//
//		objectController = GameObject.Find("objectController").GetComponent<objectController>();
//		itemController = GameObject.Find("itemController").GetComponent<itemController>();
//		enemyController = GameObject.Find("enemyController").GetComponent<enemyController>();

        menu.SetActive(false);
        playerController.isControllable = true;
        cameraController.isControllable = true;
    }