Beispiel #1
0
 // Use this for initialization
 void Start( )
 {
     m_property = GetComponentInParent <HeroProperty>();
     enemies    = new Dictionary <GameObject, BaseProperty>();
     m_leaveGo  = new List <GameObject>();
     m_radius   = GetComponent <SphereCollider>().radius + 2;
 }
Beispiel #2
0
 void Start()
 {
     _Animation            = GetComponentInChildren <Animation>();
     _CharacterController  = GetComponent <CharacterController>();
     _HeroAnimationControl = GetComponent <HeroAnimationControl>();
     _HeroAttackControl    = GetComponent <HeroAttackControl>();
     _PlayerInputControl   = GetComponent <PlayerInputControl>();
     _HeroProperty         = GetComponent <HeroProperty>();
 }
Beispiel #3
0
    // Use this for initialization
    void Start()
    {
        mControl = gameObject.AddComponent<HeroControl> () as HeroControl;
        mControl.mHero = this;
        mMotion = gameObject.AddComponent<HeroMotion> () as HeroMotion;
        mMotion.mHero = this;
        mProperty = gameObject.AddComponent<HeroProperty> () as HeroProperty;

        mAnimator = gameObject.GetComponent<Animator>() as Animator;
    }
Beispiel #4
0
 // Use this for initialization
 void Start( )
 {
     hero     = GameObject.Find(PlayerPrefs.GetString("player name"));
     property = hero.GetComponent <HeroProperty>();
     for (int i = 0; i < 4; i++)
     {
         m_texts[i] = GetComponentsInChildren <Text>()[i];
     }
     m_slider = GetComponentInChildren <Slider>();
 }
Beispiel #5
0
 // Use this for initialization
 void Start()
 {
     arr = new string[3] {
         "absorb", "kill", "run"
     };
     character     = GameSceneManager.localHero;
     currentTime   = coolingTimer;
     show_cooltime = transform.Find("Text").GetComponent <Text>();
     character_p   = character.GetComponent <HeroProperty>();
 }
	public HeroData()
	{
		property = new HeroProperty ();
        equipmentList = new EquipmentList();
        realmList = new HeroRealm();
		skillList = new SkillManager();
		bufferController = new BufferController();
		battle = -1;
        level = 1;
	}
Beispiel #7
0
    // Use this for initialization
    void Start()
    {
        mControl       = gameObject.AddComponent <HeroControl> () as HeroControl;
        mControl.mHero = this;
        mMotion        = gameObject.AddComponent <HeroMotion> () as HeroMotion;
        mMotion.mHero  = this;
        mProperty      = gameObject.AddComponent <HeroProperty> () as HeroProperty;


        mAnimator = gameObject.GetComponent <Animator>() as Animator;
    }
Beispiel #8
0
 public static void OnGUI(UnityModManager.ModEntry modEntry)
 {
     settings.Draw(modEntry);
     if (GUILayout.Button("立即存档"))
     {
         var hero = DataMgr.Instance.HeroProperty;
         HeroProperty.SaveSceneName(hero.SceneName);
         HeroProperty.SaveGameProgress(hero.GameProgress);
         MsgBoxMgr.ShowMsg_0Btn("保存成功", (string)null, -1, true);
     }
 }
Beispiel #9
0
    // Use this for initialization
    void Start()
    {
        count       = 0;
        text        = transform.Find("Text").GetComponent <Text>();
        character   = GameSceneManager.localHero;
        character_p = character.GetComponent <HeroProperty>();
        weapon_p    = transform.GetComponent <PropsProperty>();

        character_compoment = character.GetComponent <HeroProperty>();
        truecd = character_compoment.attackCd;
    }
Beispiel #10
0
    public void Get()
    {
        hero     = GameObject.Find(PlayerPrefs.GetString("player name"));
        property = hero.GetComponent <HeroProperty>();

        Slider[] _sliders = GetComponentsInChildren <Slider>();
        life = _sliders[0];
        mana = _sliders[1];

        Text[] _text = GetComponentsInChildren <Text>();
        lifeText = _text[0];
        manaText = _text[1];
    }
Beispiel #11
0
    // Use this for initialization
    void Start( )
    {
        m_tag                   = gameObject.tag;
        m_agent                 = GetComponent <NavMeshAgent>();
        m_animator              = GetComponent <Animator>();
        m_camera                = Camera.main;
        m_mainCameraTf          = Camera.main.transform;
        m_mainCameraTf.position = transform.position + offsetCamera;
        m_property              = GetComponent <HeroProperty>();
        m_initSpeed             = m_agent.speed;
        m_size                  = GetComponent <Collider>().bounds.size;

        Init();
    }
Beispiel #12
0
 public void SetCharacter(GameObject pp)
 {
     p = pp.GetComponent <HeroProperty>();
 }
Beispiel #13
0
 protected void GetHeroProperty( )
 {
     m_hero     = GameObject.Find(PlayerPrefs.GetString("player name"));
     m_property = m_hero.GetComponent <HeroProperty>();
 }
Beispiel #14
0
 // Use this for initialization
 void Start( )
 {
     m_hero     = GameObject.Find(PlayerPrefs.GetString("player name"));
     m_property = m_hero.GetComponent <HeroProperty>();
     m_gold     = GetComponentInChildren <Text>();
 }
Beispiel #15
0
    public void Deserialize(PHeroAttr data, bool notifyChange)
    {
        EntityID      = data.heroId;
        ConfigID      = data.heroCfgId;
        StarLevel     = data.starLv;
        FightingScore = data.fighting;
        Exp           = data.xiuwei;
        Level         = data.level;

        EquipedItem.Clear();
        foreach (var item in data.fitups)
        {
            ItemInfo info = new ItemInfo();
            info.Deserialize(item);
            EquipedItem.Add(info);
        }

        LearnedSkill.Clear();
        foreach (var item in data.skillList)
        {
            SkillInfo info = new SkillInfo();
            info.Deserialize(item);
            LearnedSkill.Add(info);
        }

        HeroProperty oldProperty = Property;

        if (data.basicAttr != null)
        {
            Property.Strength     = data.basicAttr.strength;
            Property.Intelligence = data.basicAttr.Intelligence;
            Property.Leadership   = data.basicAttr.LeaderShip;
        }

        if (data.battleAttr != null)
        {
            Property.Attack      = data.battleAttr.physAtk;
            Property.MagicAttack = data.battleAttr.magicAtk;
            Property.Hp          = data.battleAttr.hp;
            Property.Def         = data.battleAttr.damReduce;
            Property.Critical    = data.battleAttr.criticStrike;
            Property.Stum        = data.battleAttr.damDeepen;
            Property.AttackSpeed = data.battleAttr.atkSpeed;
            Property.Cooldown    = data.battleAttr.coolDown;
        }

        if (notifyChange)
        {
            const float delayTimeInterval = 0.2f;
            float       delayTime         = 0;
            if (Property.Strength != oldProperty.Strength)
            {
                AddFloatingMsg(Str.Get("ATTR_STR"), Property.Strength - oldProperty.Strength, delayTime);
                delayTime += delayTimeInterval;
            }

            if (Property.Intelligence != oldProperty.Intelligence)
            {
                AddFloatingMsg(Str.Get("ATTR_INT"), Property.Intelligence - oldProperty.Intelligence, delayTime);
                delayTime += delayTimeInterval;
            }

            if (Property.Leadership != oldProperty.Leadership)
            {
                AddFloatingMsg(Str.Get("ATTR_LEADER"), Property.Leadership - oldProperty.Leadership, delayTime);
                delayTime += delayTimeInterval;
            }

            if (Property.Attack != oldProperty.Attack)
            {
                AddFloatingMsg(Str.Get("ATTR_ATTACK"), Property.Attack - oldProperty.Attack, delayTime);
                delayTime += delayTimeInterval;
            }

            if (Property.MagicAttack != oldProperty.MagicAttack)
            {
                AddFloatingMsg(Str.Get("ATTR_MAGIC_ATTACK"), Property.MagicAttack - oldProperty.MagicAttack, delayTime);
                delayTime += delayTimeInterval;
            }

            if (Property.Hp != oldProperty.Hp)
            {
                AddFloatingMsg(Str.Get("ATTR_HP"), Property.Hp - oldProperty.Hp, delayTime);
                delayTime += delayTimeInterval;
            }

            if (Math.Abs(Property.Def - oldProperty.Def) > 0.01f)
            {
                AddFloatingMsg(Str.Get("ATTR_DEF"), Property.Def - oldProperty.Def, delayTime);
                delayTime += delayTimeInterval;
            }

            if (Math.Abs(Property.Critical - oldProperty.Critical) > 0.01f)
            {
                AddFloatingMsg(Str.Get("ATTR_CRIT"), Property.Critical - oldProperty.Critical, delayTime);
                delayTime += delayTimeInterval;
            }

            if (Math.Abs(Property.HpSorb - oldProperty.HpSorb) > 0.01f)
            {
                AddFloatingMsg(Str.Get("ATTR_HP_SORB"), Property.HpSorb - oldProperty.HpSorb, delayTime);
                delayTime += delayTimeInterval;
            }

            if (Math.Abs(Property.Stum - oldProperty.Stum) > 0.01f)
            {
                AddFloatingMsg(Str.Get("ATTR_STUM"), Property.Stum - oldProperty.Stum, delayTime);
                delayTime += delayTimeInterval;
            }

            if (Property.AttackSpeed != oldProperty.AttackSpeed)
            {
                AddFloatingMsg(Str.Get("ATTR_ATTACK_SPEED"), Property.AttackSpeed - oldProperty.AttackSpeed, delayTime);
                delayTime += delayTimeInterval;
            }

            if (Math.Abs(Property.Cooldown - oldProperty.Cooldown) > 0.01f)
            {
                AddFloatingMsg(Str.Get("ATTR_CD"), Property.Cooldown - oldProperty.Cooldown, delayTime);
                delayTime += delayTimeInterval;
            }
        }
    }