Exemplo n.º 1
0
        //---------------------------------------------------
        // LoadCoroutine
        //---------------------------------------------------
        IEnumerator LoadCoroutine(string path, Vector3 pos, Vector3 rot, playeDelegate callback)
        {
            yield return(Common.LoadAsync(path, (obj) =>
            {
                EffectData data = new EffectData(path);
                data._originalPrefab = obj as GameObject;
                GameObject go = GameObject.Instantiate(data._originalPrefab);

                data._cacheList.Add(go);
                go.transform.position = pos;
                go.transform.Rotate(rot);

                _effectList.Add(path, data);

                if (callback != null)
                {
                    callback(go);
                }
            }));
        }
Exemplo n.º 2
0
        //---------------------------------------------------
        // CreateData
        //---------------------------------------------------
        static byte[] CreateData(SettingData securityObject, UnityEngine.Object asset)
        {
            securityObject = Resources.Load <SettingData>(SecurityFilePath);

            ActionData actionData = asset as ActionData;

            //アクションデータ
            if ((actionData) != null)
            {
                byte[] hash = Master.CreateActionDataHash(actionData);
                securityObject.AddHashData(new SettingData.HashDataList(Master.TYPE.ACTION, hash));

                return(hash);
            }

            BulletData bulletData = asset as BulletData;

            //弾データ
            if (bulletData != null)
            {
                byte[] hash = Master.CreateBulletDataHash(bulletData);
                securityObject.AddHashData(new SettingData.HashDataList(Master.TYPE.BULLET, hash));

                return(hash);
            }

            CharacterData characterData = asset as CharacterData;

            //キャラクターデータ
            if (characterData != null)
            {
                byte[] hash = Master.CreateCharacterDataHash(characterData);
                securityObject.AddHashData(new SettingData.HashDataList(Master.TYPE.CHARACTER, hash));

                return(hash);
            }

            EffectData effectData = asset as EffectData;

            //エフェクトデータ
            if (effectData != null)
            {
                byte[] hash = Master.CreateEffectDataHash(effectData);
                securityObject.AddHashData(new SettingData.HashDataList(Master.TYPE.EFFECT, hash));

                return(hash);
            }

            ItemData itemData = asset as ItemData;

            //アイテムデータ
            if (itemData != null)
            {
                byte[] hash = Master.CreateItemDataHash(itemData);
                securityObject.AddHashData(new SettingData.HashDataList(Master.TYPE.ITEM, hash));

                return(hash);
            }

            StageData stageData = asset as StageData;

            //ステージデータ
            if (stageData != null)
            {
                byte[] hash = Master.CreateStageDataHash(stageData);
                securityObject.AddHashData(new SettingData.HashDataList(Master.TYPE.STAGE, hash));

                return(hash);
            }

            SeedData seedData = asset as SeedData;

            if (seedData != null)
            {
                byte[] hash = Master.CreateSeedDataHash(seedData);
                securityObject.AddHashData(new SettingData.HashDataList(Master.TYPE.SEED, hash));

                return(hash);
            }

            return(null);
        }