コード例 #1
0
 private void OnAbilityCast(CharacterModel model, IAbility ability, Data.Vector2 target)
 {
     if (ability is ProjectileAbility)
     {
         ProjectileView projectile = GameObjectExtensions.Instantiate(projectilePrefab, transform.parent).GetComponent <ProjectileView>();
         projectile.Animator.runtimeAnimatorController
             = UnityDataProvider.LoadAsset <RuntimeAnimatorController>("Abilities/Ability_" + ability.Name + "_Projectile");
         projectile.transform.localPosition = model.Position.ToUnityVector();
         projectile.Target = target.ToUnityVector();
     }
 }
コード例 #2
0
        static UnityApplication()
        {
            JsonSerializer serializer = new JsonSerializer()
            {
                Formatting = Formatting.Indented
            };

#if UNITY_EDITOR
            DataProvider = new UnityDataProvider(serializer, "Assets/Resources", "UserData");
#else
            DataProvider = new UnityDataProvider(serializer, null, UnityEngine.Application.persistentDataPath);
#endif
        }