123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using UnityEngine;
- using System.Collections;
- using CommonLang;
- using System.Collections.Generic;
- using CommonAI.Zone.ZoneEditor;
- using CommonAIClient.Unity.Utils;
- using CommonAI.ZoneClient;
- namespace CommonAIClient.Unity.Battle
- {
- public partial class BattleScene
- {
- HashMap<string, BattleFlag> mFlags = new HashMap<string, BattleFlag>();
- public T GetFlag<T>(string name) where T : BattleFlag
- {
- return mFlags.Get(name) as T;
- }
- protected void InitDecoration()
- {
- foreach (var zf in mBattle.Layer.Flags)
- {
- if (zf is ZoneEditorDecoration)
- {
- BattleDecoration dc = new BattleDecoration(this, zf as ZoneEditorDecoration);
- mFlags.Add(dc.Name, dc);
- dc.OnChanged();
- }
- }
- }
- private void Layer_DecorationChanged(ZoneLayer layer, ZoneEditorDecoration ed)
- {
- var dc = GetFlag<BattleDecoration>(ed.Name);
- if (dc != null)
- {
- dc.OnChanged();
- }
- }
- }
- }
|