Esempio n. 1
0
    public void GiveCombination(string weaponType)
    {
        //Debug.Log(weaponType);
        CreateCombination cc = GetComponentInChildren <CreateCombination>();

        if (cc)
        {
            cc.GiveCustomCombo(weaponCombination);
            cc.UseCustomCombo();
        }
        else
        {
            Debug.Log("No Create Combination attached");
        }
        WeaponCombination wc = GetComponentInChildren <WeaponCombination>();

        if (wc)
        {
            wc.SwapWeapon(weaponType);
        }
        else
        {
            Debug.Log("No Create Weapon Combination attached");
        }
    }
    public void PawnControllerStart()
    {
        this.body           = GameObject.FindWithTag(this.tag).GetComponentInChildren <CreateCombination>();
        this.playerAnimator = GetComponentInChildren <PlayerMoveAnim>().gameObject.GetComponent <Animator>();
        this.inBattle       = false;
        this.posController  = this.gameObject.GetComponent <PlayerPositionController>();
        // initialize weapon if player is supposed to have one
        CallSetWeapon("Sword");
        if (!spawnWithWeapon)
        {                                    //
            this.weaponComboScript.AllOff(); // Creates a weapon, sets it to the player's hand and makes it invisible.
            this.weaponComboScript.SwapNow();
        }

        if (spawnWithArmor)
        {
            int randomNum = Random.Range(0, 3);
            switch (randomNum)
            {
            case 0: CallSetArmor("HeavyArmor");
                break;

            case 1: CallSetArmor("MediumArmor");
                break;

            case 2: CallSetArmor("LightArmor");
                break;
            }
        }
        else
        {
            CallSetArmor("BlankArmor");
            this.playerArmor.gameObject.GetComponentInChildren <SpriteRenderer>().enabled = false;
        }
    }