// Use this for initialization
        void Start()
        {
            orc.TakeDamage();

            gameObjects = new CustomList <GameObject>();
            gameObjects.Add(new GameObject());
            gameObjects.Add(new GameObject());
            gameObjects.Add(new GameObject());
            gameObjects.Add(new GameObject());
            gameObjects.Add(new GameObject());

            GameObject firstObject = gameObjects[0];
        }
Ejemplo n.º 2
0
    private void FixedUpdate()
    {
        animator.SetBool("isAttack", isAttack);
        animator.SetBool("isDead", isDeath);
        animator.SetBool("isDamage", isHit);
        if (Physics.Raycast(transform.position, transform.forward, out hit, 50))
        {
            if (hit.collider.tag == "OrcDagger" || hit.collider.tag == "OrcSpear" || hit.collider.tag == "OrcKing" || hit.collider.tag == "WereWolf" || hit.collider.tag == "BlackWolf" || hit.collider.tag == "WhiteWolf" || hit.collider.tag == "MiniBot" || hit.collider.tag == "MegaBot")
            {
                Orc orc = hit.collider.GetComponent <Orc>();
                if (orc.isAttack == true) // player action
                {
                    if (isDeath == false)
                    {
                        isHit = true;

                        animator.SetBool("isDamage", isHit);
                        character.characterDefinition.TakeDamage(orc.CDamage);
                        orc.isAttack = false;
                    }
                    if (isDeath)
                    {
                        cm.PanelToDisable[3].SetActive(false);
                    }
                }
                if (isAttack == true)
                { // enemy action
                    orc.TakeDamage(character.characterDefinition.currentDamage);
                    orc.Hit(true);
                    isAttack = false;
                }
                isHit    = false;
                isAttack = false;
            }
        }
    }