Exemple #1
0
    protected override void OnShow(object userData)
    {
        base.OnShow(userData);

        powerBarData = userData as PowerBarData;
        if (powerBarData == null)
        {
            Log.Error("PowerBar data is invalid.");
            return;
        }

        GameEntry.Entity.AttachEntity(this.Id, powerBarData.OwnerId, "HPBarPosition");
    }
Exemple #2
0
    protected override void OnShow(object userData)
    {
        base.OnShow(userData);

        fightEntityData = userData as FightEntityData;
        if (fightEntityData == null)
        {
            Log.Error("fightEntityData is invalid.");
            return;
        }

        // CachedTransform.localScale = Vector3.one;

        manualWeapons.Clear();
        autoWeapons.Clear();
        skillWeapons.Clear();

        /* 附加血量条 */
        PowerBarData hpBarData = new PowerBarData(EntityExtension.GenerateSerialId(), 1, this.Id, CampType.Player);

        EntityExtension.ShowPowerBar(typeof(PowerBar), "PowerBarGroup", hpBarData);
    }