Esempio n. 1
0
    //RELEASE BUNDLE END//

    void OnTriggerStay2D(Collider2D col)
    {
        if (!occupied)
        {
            if (col.GetComponent <WeaponBlockScript>())
            {
                weaponBlockScript = col.GetComponent <WeaponBlockScript>();
                if (!weaponBlockScript.nowProjectile && weaponBlockScript.toggleCount < 1)
                {
                    blockInSlot = col.gameObject;
                    occupied    = true;
                    weaponBlockScript.wepDSID = wepDSID;
                    StartCoroutine(weaponBlockScript.LockIn());
                    StartCoroutine(CatalogWeapons());
                }
            }
            else if (col.GetComponent <MiniCopterBlock>())
            {
                miniCopterBlock = col.GetComponent <MiniCopterBlock>();
                if (!miniCopterBlock.recovering && miniCopterBlock.toggleCount < 1)
                {
                    blockInSlot             = col.gameObject;
                    occupied                = true;
                    miniCopterBlock.wepDSID = wepDSID;
                    StartCoroutine(miniCopterBlock.LockIn());
                    StartCoroutine(CatalogWeapons());
                }
            }
        }
    }
    //RELEASE BUNDLE END//
    void OnTriggerStay2D(Collider2D col)
    {
        if (!occupied){
            if ( col.GetComponent<WeaponBlockScript>() ) {
                weaponBlockScript = col.GetComponent<WeaponBlockScript>();
                if (!weaponBlockScript.nowProjectile && weaponBlockScript.toggleCount<1){
                    blockInSlot = col.gameObject;
                    occupied = true;
                    weaponBlockScript.wepDSID = wepDSID;
                    StartCoroutine(weaponBlockScript.LockIn());
                    StartCoroutine(CatalogWeapons());
                }

            }
            else if ( col.GetComponent<MiniCopterBlock>() ){
                miniCopterBlock = col.GetComponent<MiniCopterBlock>();
                if (!miniCopterBlock.recovering && miniCopterBlock.toggleCount<1){
                    blockInSlot = col.gameObject;
                    occupied = true;
                    miniCopterBlock.wepDSID = wepDSID;
                    StartCoroutine(miniCopterBlock.LockIn());
                    StartCoroutine(CatalogWeapons());
                }
            }
        }
    }
    public IEnumerator ToggleWeapons()
    {
        playToggle = false;
        yield return StartCoroutine (CatalogWeapons ());
        foreach (GameObject block in storedWeapons) {
            if (block){
                playToggle = true;
                if (block.GetComponent<WeaponBlockScript>()){
                    weaponBlockScript = block.GetComponent<WeaponBlockScript>();
                    weaponBlockScript.lockedin = false;
                    switch (weaponBlockScript.toggleCount){
                    case 1:
                        weaponBlockScript.toggleCount = 2;
                        block.transform.position = slot1;

                        break;
                    case 2:
                        weaponBlockScript.toggleCount = 3;
                        block.transform.position = slot2;
                        break;
                    case 3:
                        weaponBlockScript.toggleCount = 4;
                        block.transform.position = slot3;
                        break;
                    case 4:
                        weaponBlockScript.toggleCount = 1;
                        StartCoroutine(weaponBlockScript.LockIn());
                        blockInSlot = block;
                        block.transform.position = hPos;
                        break;
                    }
                }
                else if (block.GetComponent<MiniCopterBlock>()){
                    miniCopterBlock = block.GetComponent<MiniCopterBlock>();
                    miniCopterBlock.lockedin = false;
                    switch (miniCopterBlock.toggleCount){
                    case 1:
                        miniCopterBlock.toggleCount = 2;
                        block.transform.position = slot1;
                        break;
                    case 2:
                        miniCopterBlock.toggleCount = 3;
                        block.transform.position = slot2;
                        break;
                    case 3:
                        miniCopterBlock.toggleCount = 4;
                        block.transform.position = slot3;
                        break;
                    case 4:
                        miniCopterBlock.toggleCount = 1;
                        StartCoroutine(miniCopterBlock.LockIn());
                        blockInSlot = block;
                        block.transform.position = hPos;
                        break;
                    }
                }
            }
        }
        if (playToggle){
            toggleWeapons.Play();
        }
        yield return StartCoroutine (CatalogWeapons ());
    }
    public IEnumerator CombineWeapons()
    {
        if (combinator){
            yield return StartCoroutine (CatalogWeapons ());
            if (blockTypes[1] == blockTypes[2] && blockTypes[1] == blockTypes[3] && (blockTypes[1] == 1 || blockTypes[1] ==2 || blockTypes[1] ==3 || blockTypes[1] == 7 || blockTypes[1] == 11)){
                if (occupied){
                    slotSpot4SuperBlock = slot3; //Check me for changes to slot Spots and slots and so on
                    lockstatus = false;
                    slotNum = 4;
                }
                else{
                    slotSpot4SuperBlock = hPos;
                    lockstatus = true;
                    slotNum = 1;
                }

                switch (blockTypes[1]){
                case 1:
                    superBlockPath = superNeutralBlockPath;
                    break;
                case 2:
                    superBlockPath = superExplosiveBlockPath;
                    break;
                case 3:
                    superBlockPath = superFrozesplosiveBlockPath;
                    break;
                case 7:
                    superBlockPath = superTelekineticBlockPath;
                    break;
                case 11:
                    superBlockPath = superTurretBlockPath;
                    break;
                }

                superBlock = Instantiate ( Resources.Load (superBlockPath),slotSpot4SuperBlock,Quaternion.identity) as GameObject;
                weaponBlockScript = superBlock.GetComponent<WeaponBlockScript>();
                weaponBlockScript.wepDSID = wepDSID;
                weaponBlockScript.toggleCount = slotNum;
                if (lockstatus){
                    StartCoroutine(weaponBlockScript.LockIn());
                }
                superBlock.collider2D.isTrigger = true;

                i=1;
                while ( i<storedWeapons.Length ){
                    Destroy (storedWeapons[i]);
                    i++;
                }
            }
        }
        yield return StartCoroutine (CatalogWeapons ());
    }
Esempio n. 5
0
    public IEnumerator ToggleWeapons()
    {
        playToggle = false;
        yield return(StartCoroutine(CatalogWeapons()));

        foreach (GameObject block in storedWeapons)
        {
            if (block)
            {
                playToggle = true;
                if (block.GetComponent <WeaponBlockScript>())
                {
                    weaponBlockScript          = block.GetComponent <WeaponBlockScript>();
                    weaponBlockScript.lockedin = false;
                    switch (weaponBlockScript.toggleCount)
                    {
                    case 1:
                        weaponBlockScript.toggleCount = 2;
                        block.transform.position      = slot1;

                        break;

                    case 2:
                        weaponBlockScript.toggleCount = 3;
                        block.transform.position      = slot2;
                        break;

                    case 3:
                        weaponBlockScript.toggleCount = 4;
                        block.transform.position      = slot3;
                        break;

                    case 4:
                        weaponBlockScript.toggleCount = 1;
                        StartCoroutine(weaponBlockScript.LockIn());
                        blockInSlot = block;
                        block.transform.position = hPos;
                        break;
                    }
                }
                else if (block.GetComponent <MiniCopterBlock>())
                {
                    miniCopterBlock          = block.GetComponent <MiniCopterBlock>();
                    miniCopterBlock.lockedin = false;
                    switch (miniCopterBlock.toggleCount)
                    {
                    case 1:
                        miniCopterBlock.toggleCount = 2;
                        block.transform.position    = slot1;
                        break;

                    case 2:
                        miniCopterBlock.toggleCount = 3;
                        block.transform.position    = slot2;
                        break;

                    case 3:
                        miniCopterBlock.toggleCount = 4;
                        block.transform.position    = slot3;
                        break;

                    case 4:
                        miniCopterBlock.toggleCount = 1;
                        StartCoroutine(miniCopterBlock.LockIn());
                        blockInSlot = block;
                        block.transform.position = hPos;
                        break;
                    }
                }
            }
        }
        if (playToggle)
        {
            toggleWeapons.Play();
        }
        yield return(StartCoroutine(CatalogWeapons()));
    }
Esempio n. 6
0
    public IEnumerator CombineWeapons()
    {
        if (combinator)
        {
            yield return(StartCoroutine(CatalogWeapons()));

            if (blockTypes[1] == blockTypes[2] && blockTypes[1] == blockTypes[3] && (blockTypes[1] == 1 || blockTypes[1] == 2 || blockTypes[1] == 3 || blockTypes[1] == 7 || blockTypes[1] == 11))
            {
                if (occupied)
                {
                    slotSpot4SuperBlock = slot3;                     //Check me for changes to slot Spots and slots and so on
                    lockstatus          = false;
                    slotNum             = 4;
                }
                else
                {
                    slotSpot4SuperBlock = hPos;
                    lockstatus          = true;
                    slotNum             = 1;
                }

                switch (blockTypes[1])
                {
                case 1:
                    superBlockPath = superNeutralBlockPath;
                    break;

                case 2:
                    superBlockPath = superExplosiveBlockPath;
                    break;

                case 3:
                    superBlockPath = superFrozesplosiveBlockPath;
                    break;

                case 7:
                    superBlockPath = superTelekineticBlockPath;
                    break;

                case 11:
                    superBlockPath = superTurretBlockPath;
                    break;
                }

                superBlock                    = Instantiate(Resources.Load(superBlockPath), slotSpot4SuperBlock, Quaternion.identity) as GameObject;
                weaponBlockScript             = superBlock.GetComponent <WeaponBlockScript>();
                weaponBlockScript.wepDSID     = wepDSID;
                weaponBlockScript.toggleCount = slotNum;
                if (lockstatus)
                {
                    StartCoroutine(weaponBlockScript.LockIn());
                }
                superBlock.collider2D.isTrigger = true;

                i = 1;
                while (i < storedWeapons.Length)
                {
                    Destroy(storedWeapons[i]);
                    i++;
                }
            }
        }
        yield return(StartCoroutine(CatalogWeapons()));
    }