// Use this for initialization
 void Start()
 {
     text             = GetComponentInChildren <MeshRenderer>();
     sr               = GetComponentInChildren <SpriteRenderer>();
     playerInventory  = GameObject.FindGameObjectWithTag("Player").GetComponent <InventoryController>();
     playerController = playerInventory.gameObject.GetComponent <PlatformCharController>();
 }
Exemple #2
0
    void Start()
    {
        controller = GetComponent <PlatformCharController>();

        GameObject cursor = GameObject.FindGameObjectWithTag("InventoryCursor");

        cursorPosition = cursor.GetComponent <RectTransform>();
        cursorImage    = cursor.GetComponent <Image>();

        if (InventoryPanels.Length != DefaultSpaces.Length)
        {
            throw new System.Exception("InventoryPanels and Default Spaces are not the same length!");
        }

        _spaces = DefaultSpaces;

        /*
         * for (int i = 0; i < _spaces.Length; i++)
         * {
         *  _spaces[i] = PickUp.Bomb;
         * }
         *
         * _spaces[0] = PickUp.Sword;
         * _spaces[1] = PickUp.Bow;
         */
    }
 void Start()
 {
     pc = GetComponentInParent <PlatformCharController>();
 }