// METHODS private void Start() { SetCenters(); _resourceCenter = FindObjectOfType <ResourceCenter>(); _enemies = new List <EnemyCardGameObject>(); _playerHand = new List <HandCardGameObject>(); _gameManager = new GameManager(this); _gameManager.Init(); }
public void Push(string name, ResourceCenter.AssetType type = ResourceCenter.AssetType.normal, ResourceCenter.Handle handle = null) { if (string.IsNullOrEmpty(name)) return; //Debug.Log(string.Format("push : {0}\n", name)); int idx = mToLoadList.FindIndex((SceneAsset l) => { return name == l.ResName && type == l.Type; }); if (idx == -1) { mToLoadList.Add(new SceneAsset(name, type, handle)); mDone = false; } }
public SceneAsset(string name, ResourceCenter.AssetType type, ResourceCenter.Handle handle) { ResName = name; Type = type; Handle = handle; }
public void AddExts(string exts) { exts = exts.ToLower(); ResourceCenter.SetFileExts(exts); }
private static void ExecuteEffectEvent(ActionStatus status, EffectEventArgs args) { Transform parent = null; switch (args.BindingType) { case EffectBindingType.BindingOnwer: { parent = status.Onwer.CacheTransform; } break; case EffectBindingType.BindingSkeleton: { parent = status.Onwer.GetSkeleton(args.BindingSkeletonName); } break; } GameObject inst = null; PrefabPool prefabPool; if (_prefabInst.TryGetValue(args.ResourcePath, out prefabPool)) { inst = prefabPool.SpawnInstance().gameObject; } else { var prefab = (GameObject)ResourceCenter.LoadAsset(args.ResourcePath); prefabPool = new PrefabPool(prefab.transform); inst = prefabPool.SpawnInstance().gameObject; _prefabInst.Add(args.ResourcePath, prefabPool); } inst.transform.parent = parent; inst.transform.localPosition = new Vector3(args.PositionX * 0.01f, args.PositionY * 0.01f, args.PositionZ * 0.01f); inst.transform.localRotation = Quaternion.Euler(args.RotateX, args.RotateY, args.RotateZ); switch (args.LifeType) { case EffectLifeType.OwnerHit: break; case EffectLifeType.InterruptAction: break; case EffectLifeType.FollowAction: case EffectLifeType.TimeOut: { DelayDestroy delayDestroy = inst.GetComponent <DelayDestroy>(); if (delayDestroy == null) { delayDestroy = inst.AddComponent <DelayDestroy>(); delayDestroy.OnCompleta = OnRecycle; } delayDestroy.ResourceName = args.ResourcePath; delayDestroy.TimeMs = args.LifeTime; delayDestroy.Start(); } break; } inst.SetActive(true); }