コード例 #1
0
    /// <summary>
    /// 指定した名前のパーティクル再生
    ///     初めて再生するパーティクルはプール用オブジェクトを生成
    /// </summary>
    /// <param name="particleName">Particle name.</param>
    /// <param name="position">Position.</param>
    ///



    //指定座標に表示する
    public static void PlayParticle(string particleName, Vector3 position)
    {
        ParticlePooler pooler = particlePoolerList.Where(tempPooler => tempPooler.ParticleName == particleName).FirstOrDefault();

        if (pooler == null)
        {
            //取得できなければ新たに生成
            pooler = new ParticlePooler(particleName);
            particlePoolerList.Add(pooler);
        }
        pooler.Play(position);
    }
コード例 #2
0
 protected override void Check(int procs)
 {
     if (procs > 0)
     {
         var p        = ParticlePooler.Request(particlePrefab, tr.position);
         var newBurst = baseBurst;
         var ct       = newBurst.count;
         ct.constant   *= burstScale(procs);
         newBurst.count = ct;
         p.System.emission.SetBurst(0, newBurst);
     }
 }
コード例 #3
0
 private void Awake()
 {
     if (instance == null)
     {
         InitializeHitFX();
         instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
コード例 #4
0
    /// <summary>
    /// 指定した名前のパーティクル再生
    /// 初めて再生するパーティクルはプール用オブジェクトを生成
    /// </summary>
    public void Play(string particleName, Vector3 position, Material material = null)
    {
        //リストから指定した名前のプール用オブジェクトを取得
        ParticlePooler pooler = particlePoolerList.Where(tempPooler => tempPooler.ParticleName == particleName).FirstOrDefault();

        if (pooler == null)
        {
            //取得できなければ新たに生成
            pooler = new ParticlePooler(particleName, this.transform);
            particlePoolerList.Add(pooler);
        }
        pooler.Play(position, material);
    }
コード例 #5
0
ファイル: EffectStrategy.cs プロジェクト: Bagoum/danmokou
 private GameObject?ProcGO(Vector2 source, Vector2 target, float targetPerimeterRadius)
 {
     ProcMinors();
     foreach (var sub in subEffects)
     {
         sub.Proc(source, target, targetPerimeterRadius);
     }
     if (spawnType == SpawnableType.Particle)
     {
         return(ParticlePooler.Request(particlePrefab, locator.Locate(source, target, targetPerimeterRadius))
                .gameObject);
     }
     else if (spawnType == SpawnableType.RawInstantiate)
     {
         GameObject w = GameObject.Instantiate(particlePrefab);
         w.transform.localPosition = locator.Locate(source, target, targetPerimeterRadius);
         return(w);
     }
     return(null);
 }
コード例 #6
0
        private void Awake()
        {
            if (gm != null)
            {
                DestroyImmediate(gameObject);
                return;
            }
            Initialized = true;
            gm          = this;
            DontDestroyOnLoad(this);

            //This looks silly, but the static initializer needs to be actively run to ensure that the locale is set correctly.
            _ = SaveData.s;

            Log.Unity($"Danmokou {EngineVersion}, {References.gameIdentifier} {References.gameVersion}");
            SceneIntermediary.Setup(References.defaultTransition);
            ParticlePooler.Prepare();
            GhostPooler.Prepare(Prefabs.cutinGhost);
            BEHPooler.Prepare(Prefabs.inode);
            ItemPooler.Prepare(References.items);
            ETime.RegisterPersistentSOFInvoke(Replayer.BeginFrame);
            ETime.RegisterPersistentSOFInvoke(Enemy.FreezeEnemies);
            ETime.RegisterPersistentEOFInvoke(BehaviorEntity.PrunePoolControls);
            ETime.RegisterPersistentEOFInvoke(CurvedTileRenderLaser.PrunePoolControls);
            SceneIntermediary.RegisterSceneUnload(ClearForScene);
            SceneIntermediary.RegisterSceneLoad(OnSceneLoad);

            //The reason we do this instead of Awake is that we want all resources to be
            //loaded before any State Machines are constructed, which may occur in other entities' Awake calls.
            GetComponent <ResourceManager>().Setup();
            GetComponent <BulletManager>().Setup();
            GetComponentInChildren <SFXService>().Setup();
            GetComponentInChildren <AudioTrackService>().Setup();

            if (References.achievements != null)
            {
                Achievements = References.achievements.MakeRepo().Construct();
            }

            RunDroppableRIEnumerator(DelayedInitialAchievementsCheck());
        }
コード例 #7
0
    //親オブジェクト指定可能
    public static void PlayParticle(string particleName, string objName, string keyName, bool distinct = false)
    {
        try
        {
            GameObject ret = GameObject.FindWithTag(keyName);
            if (distinct && ret)
            {
                ret.GetComponent <ParticleSystem>().Play();
                return;
            }
        }
        catch
        {
        }
        ParticlePooler pooler = particlePoolerList.Where(tempPooler => tempPooler.ParticleName == particleName).FirstOrDefault();

        if (pooler == null)
        {
            //取得できなければ新たに生成
            pooler = new ParticlePooler(particleName, keyName);
            particlePoolerList.Add(pooler);
        }
        pooler.Play(objName);
    }
コード例 #8
0
 private void Awake()
 {
     Instance = this;
 }
コード例 #9
0
    // Use this for initialization

    private void Awake()
    {
        current = this;
    }
コード例 #10
0
 private void Start()
 {
     particlePooler = ParticlePooler.Instance;
     StartCoroutine(Wait(cadence));
 }
コード例 #11
0
ファイル: ParticlePooler.cs プロジェクト: njunius/Inure
 void Awake()
 {
     current = this;
 }