Exemple #1
0
    void Update()
    {
        if (GlobalConditionC.freezeAll)
        {
            return;
        }
        if (st && Input.GetKeyDown("c"))
        {
            OnOffStatusMenu();
        }
        if (inv && Input.GetKeyDown("i"))
        {
            OnOffInventoryMenu();
        }
        if (sk && Input.GetKeyDown("k"))
        {
            OnOffSkillMenu();
        }
        if (qu && Input.GetKeyDown("q"))
        {
            OnOffQuestMenu();
        }

        if (mobileSkillIcon.Length > 0)
        {
            AttackTriggerC atk = GetComponent <AttackTriggerC>();
            for (int a = 0; a < mobileSkillIcon.Length; a++)
            {
                if (atk.skillCoolDown[a] > 0)
                {
                    if (mobileSkillIcon[a].coolDownText)
                    {
                        mobileSkillIcon[a].coolDownText.gameObject.SetActive(true);
                        mobileSkillIcon[a].coolDownText.text = atk.skillCoolDown[a].ToString();
                    }
                    if (mobileSkillIcon[a].coolDownBackground)
                    {
                        mobileSkillIcon[a].coolDownBackground.gameObject.SetActive(true);
                    }
                }
                else
                {
                    if (mobileSkillIcon[a].coolDownText)
                    {
                        mobileSkillIcon[a].coolDownText.gameObject.SetActive(false);
                    }
                    if (mobileSkillIcon[a].coolDownBackground)
                    {
                        mobileSkillIcon[a].coolDownBackground.SetActive(false);
                    }
                }
            }
        }
    }
Exemple #2
0
    public void SetSkillShortCutIcons()
    {
        if (!hp)
        {
            return;
        }
        AttackTriggerC atk = GetComponent <AttackTriggerC>();

        for (int a = 0; a < hp.GetComponent <HealthBarCanvasC>().skillShortcuts.Length; a++)
        {
            hp.GetComponent <HealthBarCanvasC>().skillShortcuts[a].skillIcon.sprite = atk.skill[a].iconSprite;
        }

        for (int a = 0; a < mobileSkillIcon.Length; a++)
        {
            mobileSkillIcon[a].skillIcon.sprite = atk.skill[a].iconSprite;
        }
    }
    void  Start()
    {
        if (!player)
        {
            player = this.gameObject;
        }
        mainModel = GetComponent <AttackTriggerC>().mainModel;
        if (!mainModel)
        {
            mainModel = this.gameObject;
        }
        if (!animator)
        {
            animator = mainModel.GetComponent <Animator>();
        }
        controller = player.GetComponent <CharacterController>();
        mATC       = GetComponent <AttackTriggerC>();

        mATC.useMecanim = true;
    }
    void  SwitchMode()
    {
        AttackTriggerC atkTrigger = GetComponent <AttackTriggerC>();

        if (atkTrigger.aimingType == AttackTriggerC.AimType.Normal)
        {
            atkTrigger.aimingType = AttackTriggerC.AimType.Raycast;
            if (atkTrigger.cameraZoomPoint)
            {
                atkTrigger.Maincam.GetComponent <ARPGcameraC>().target = atkTrigger.cameraZoomPoint;
            }
            atkTrigger.Maincam.GetComponent <ARPGcameraC>().targetHeight = targetHeightRayCast;
            atkTrigger.Maincam.GetComponent <ARPGcameraC>().lockOn       = true;
        }
        else
        {
            atkTrigger.aimingType = AttackTriggerC.AimType.Normal;
            atkTrigger.Maincam.GetComponent <ARPGcameraC>().target       = this.transform;
            atkTrigger.Maincam.GetComponent <ARPGcameraC>().targetHeight = targetHeightNormal;
            atkTrigger.Maincam.GetComponent <ARPGcameraC>().lockOn       = false;
        }
    }
Exemple #5
0
 // Token: 0x06000487 RID: 1159 RVA: 0x00023144 File Offset: 0x00021544
 private void SwitchMode()
 {
     AttackTriggerC component = base.GetComponent <AttackTriggerC>();
 }
    void Update()
    {
        if (!player)
        {
            Destroy(gameObject);
            return;
        }
        StatusC stat = player.GetComponent <StatusC>();

        int   maxHp  = stat.totalMaxHealth;
        float hp     = stat.health;
        int   maxMp  = stat.totalMaxMana;
        float mp     = stat.mana;
        int   exp    = stat.exp;
        float maxExp = stat.maxExp;
        //float target = (float)cur_hp / (float)cur_mhp;
        float curHp  = hp / maxHp;
        float curMp  = mp / maxMp;
        float curExp = exp / maxExp;

        /*if(curHp >= 0.75){
         *      hpBar.color = Color.green;
         *      hpBar.sprite = hp2;
         * }else{
         *      hpBar.color = Color.red;
         * }*/

        //HP Gauge
        if (curHp > hpBar.fillAmount)
        {
            hpBar.fillAmount += 1 / 1 * Time.unscaledDeltaTime;
            if (hpBar.fillAmount > curHp)
            {
                hpBar.fillAmount = curHp;
            }
        }
        if (curHp < hpBar.fillAmount)
        {
            hpBar.fillAmount -= 1 / 1 * Time.unscaledDeltaTime;
            if (hpBar.fillAmount < curHp)
            {
                hpBar.fillAmount = curHp;
            }
        }

        //MP Gauge
        if (curMp > mpBar.fillAmount)
        {
            mpBar.fillAmount += 1 / 1 * Time.unscaledDeltaTime;
            if (mpBar.fillAmount > curMp)
            {
                mpBar.fillAmount = curMp;
            }
        }
        if (curMp < mpBar.fillAmount)
        {
            mpBar.fillAmount -= 1 / 1 * Time.unscaledDeltaTime;
            if (mpBar.fillAmount < curMp)
            {
                mpBar.fillAmount = curMp;
            }
        }

        //EXP Gauge
        if (expBar)
        {
            expBar.fillAmount = curExp;
        }
        if (lvText)
        {
            lvText.text = stat.level.ToString();
        }
        if (hpText)
        {
            hpText.text = hp.ToString() + "/" + maxHp.ToString();
        }
        if (mpText)
        {
            mpText.text = mp.ToString() + "/" + maxMp.ToString();
        }

        //Cooldown
        AttackTriggerC atk = player.GetComponent <AttackTriggerC>();

        for (int a = 0; a < skillShortcuts.Length; a++)
        {
            if (atk.skillCoolDown[a] > 0)
            {
                if (skillShortcuts[a].coolDownText)
                {
                    skillShortcuts[a].coolDownText.gameObject.SetActive(true);
                    skillShortcuts[a].coolDownText.text = atk.skillCoolDown[a].ToString();
                }
                if (skillShortcuts[a].coolDownBackground)
                {
                    skillShortcuts[a].coolDownBackground.gameObject.SetActive(true);
                }
            }
            else
            {
                if (skillShortcuts[a].coolDownText)
                {
                    skillShortcuts[a].coolDownText.gameObject.SetActive(false);
                }
                if (skillShortcuts[a].coolDownBackground)
                {
                    skillShortcuts[a].coolDownBackground.SetActive(false);
                }
            }
        }
    }