예제 #1
0
    IEnumerator ActivateRoutine()
    {
        activated = true;

        if (starFX != null)
        {
            starFX.Play();
        }

        if (SoundManager.Instance != null && starSound != null)
        {
            SoundManager.Instance.PlayClipAtPoint(starSound, Vector3.zero, SoundManager.Instance.fxVolume);
        }

        yield return(new WaitForSeconds(delay));

        SetActive(true);
    }
예제 #2
0
    public void LandShapeFx()
    {
        int i = 0;

        foreach (Transform child in gameObject.transform)
        {
            if (glowSquareFx[i])
            {
                glowSquareFx[i].transform.position = child.position - Vector3.forward;
                ParticlePlayer particlePlayer = glowSquareFx[i].GetComponent <ParticlePlayer>();
                if (particlePlayer)
                {
                    particlePlayer.Play();
                }
                i++;
            }
        }
    }
예제 #3
0
파일: Player.cs 프로젝트: EmmaPham/Meow
    public void LandFX()
    {
        int i = 0;

        foreach (Transform child in gameObject.transform)
        {
            if (m_glowSquareFX[i])
            {
                m_glowSquareFX[i].transform.position = new Vector3(child.position.x, child.position.y, -2f);
                ParticlePlayer particlePlayer = m_glowSquareFX[i].GetComponent <ParticlePlayer>();
                if (particlePlayer)
                {
                    particlePlayer.Play();
                }
            }
            i++;
        }
    }
예제 #4
0
    public void BoomFX()
    {
        int i = 0;

        foreach (Transform child in gameObject.transform)
        {
            if (boomfx[i])
            {
                boomfx[i].transform.position = new Vector3(child.position.x, child.position.y, -2f);
                ParticlePlayer particleboom = boomfx[i].GetComponent <ParticlePlayer>();
                if (particleboom)
                {
                    particleboom.Play();
                }
            }
            i++;
        }
    }
예제 #5
0
    public void LandShapeFx()
    {
        int i = 0;

        foreach (Transform Child in gameObject.transform)
        {
            if (m_glowSquareFx[i])
            {
                m_glowSquareFx[i].transform.position = new Vector3(Child.position.x, Child.position.y + 1, -1) - new Vector3(0, 0, 0.1f);
                ParticlePlayer particlePlayer = m_glowSquareFx[i].GetComponent <ParticlePlayer>();
                if (particlePlayer)
                {
                    particlePlayer.Play();
                }
                i++;
            }
        }
    }
예제 #6
0
    public void LandShapeFX()
    {
        int i = 0;

        //Transform[] transforms = GetComponentsInChildren<Transform>();
        //for(int i = 0; i < m_glowSquareFX.Length; i++)
        foreach (Transform child in transform)//subistitui as duas linhas acima
        {
            if (m_glowSquareFX[i])
            {
                m_glowSquareFX[i].transform.position = new Vector3(child.position.x, child.position.y, -2);
                ParticlePlayer pp = m_glowSquareFX[i].GetComponent <ParticlePlayer>();
                if (pp)
                {
                    pp.Play();
                }
            }
            i++;
        }
    }
예제 #7
0
    public bool IsLastDetail()
    {
        bool isLastDetail = _instDetail.IsLastDetail();

        if (isLastDetail)
        {
            _allDetails.Remove(_instDetail);

            if (IsEnd())
            {
                particlePlayer.Play();
                levelMenu.PlayEndClip();
                levelMenu.ShowHomeButton();
            }
            return(true);
        }
        else
        {
            return(false);
        }
    }
예제 #8
0
        private void SetTouchEffect(Vector3 screenPosition)
        {
            if (touchEffectPrefab == null)
            {
                return;
            }

            ParticlePlayer particleController = null;

            if (cachedTouchEffects.Count != 0)
            {
                particleController = cachedTouchEffects.Dequeue();
            }
            else
            {
                particleController = UnityUtility.Instantiate <ParticlePlayer>(touchEffectRoot, touchEffectPrefab);

                UnityUtility.SetLayer(TargetLayer, particleController.gameObject, true);

                // キャッシュ目的なのでDeactiveを指定.
                particleController.EndActionType = EndActionType.Deactivate;

                particleController.OnEndAsObservable()
                .Subscribe(endEffect =>
                {
                    if (endEffect != null)
                    {
                        cachedTouchEffects.Enqueue(endEffect);
                    }
                })
                .AddTo(this);
            }

            if (!UnityUtility.IsNull(particleController))
            {
                SetTouchEffectPosition(particleController, screenPosition);

                particleController.Play().Subscribe().AddTo(this);
            }
        }
예제 #9
0
    public Shape SpawnShape()
    {
        Shape shape = null;

        //shape = Instantiate(GetRandomShape(), transform.position, Quaternion.identity) as Shape;
        shape = GetQueueShape();
        shape.transform.position = transform.position;
        //shape.transform.localScale = Vector3.one;
        StartCoroutine(GrowShape(shape, transform.position, 0.25f));
        if (m_spawnFx)
        {
            m_spawnFx.Play();
        }
        if (shape)
        {
            return(shape);
        }
        else
        {
            return(null);
        }
    }
예제 #10
0
        //----- property -----

        //----- method -----

        public IObservable <Unit> Play(string fileName, bool restart, int?sortingOrder)
        {
            var advEngine = AdvEngine.Instance;

            if (particlePlayer != null)
            {
                UnityUtility.SafeDelete(particlePlayer.gameObject);
            }

            var resourcePath = advEngine.Resource.GetResourcePath <AdvParticle>(fileName);

            var prefab = advEngine.Resource.Get <GameObject>(resourcePath);

            particlePlayer = UnityUtility.Instantiate <ParticlePlayer>(gameObject, prefab);

            if (sortingOrder.HasValue)
            {
                particlePlayer.SortingOrder = sortingOrder.Value;
            }

            return(particlePlayer.Play(restart).AsUnitObservable());
        }
예제 #11
0
    IEnumerator ActivateRoutine()
    {
        // we are activated
        activated = true;

        // play the ParticlePlayer
        if (starFX != null)
        {
            starFX.Play();
        }

        // play the starSound
        if (SoundManager.Instance != null && starSound != null)
        {
            SoundManager.Instance.PlayClipAtPoint(starSound, Vector3.zero, SoundManager.Instance.fxVolume);
        }

        yield return(new WaitForSeconds(delay));

        // turn on the icon
        SetActive(true);
    }
예제 #12
0
    public Shape SpawnShape()
    {
        Shape newShape = GetQueuedShape();

        newShape.transform.position = transform.position;

        //newShape.transform.localScale = Vector3.one;
        StartCoroutine(GrowShape(newShape, transform.position, 0.25f));

        if (spawnFx)
        {
            spawnFx.Play();
        }
        if (newShape)
        {
            return(newShape);
        }
        else
        {
            Debug.LogError("Error! Shape could not be spawned");
            return(null);
        }
    }
예제 #13
0
    public void BreakTileFXAt(int breakableValue, int x, int y, int z = 0)
    {
        GameObject     breakFX        = null;
        ParticlePlayer particlePlayer = null;

        if (breakableValue > 1)
        {
            breakFX = Instantiate(doubleBreakFXPrefab, new Vector3(x, y, z), Quaternion.identity) as GameObject;
        }
        else
        {
            breakFX = Instantiate(breakFXPrefab, new Vector3(x, y, z), Quaternion.identity) as GameObject;
        }

        if (breakFX != null)
        {
            particlePlayer = breakFX.GetComponent <ParticlePlayer>();
            if (particlePlayer != null)
            {
                particlePlayer.Play();
            }
        }
    }
예제 #14
0
        private void SetTouchEffect(Vector3 screenPosition)
        {
            if (touchEffectPrefab == null)
            {
                return;
            }

            ParticlePlayer particleController = null;

            if (cachedTouchEffects.Count != 0)
            {
                particleController = cachedTouchEffects.Dequeue();
            }
            else
            {
                particleController = UnityUtility.Instantiate <ParticlePlayer>(touchEffectRoot, touchEffectPrefab);

                UnityUtility.SetLayer((int)Layer.Overlap, particleController.gameObject, true);

                // キャッシュ目的なのでDeactiveを指定.
                particleController.EndActionType = EndActionType.Deactivate;

                particleController.OnEndAsObservable()
                .Subscribe(endEffect =>
                {
                    cachedTouchEffects.Enqueue(endEffect);
                })
                .AddTo(this);
            }

            var originPosition = renderCamera.ScreenToWorldPoint(screenPosition);

            particleController.transform.position = new Vector3(originPosition.x, originPosition.y);

            particleController.Play().Subscribe().AddTo(this);
        }
예제 #15
0
    public Shape SpawnShape()
    {
        Shape shape = null;

        shape = GetQueuedShape();//shape = Instantiate(GetRandomShape(), transform.position, Quaternion.identity) as Shape;
        shape.transform.position = transform.position;
        StartCoroutine(GrowShape(shape, transform.position, .25f));

        if (m_spawnFx)
        {
            m_spawnFx.Play();
        }

        if (shape)
        {
            return(shape);
        }
        else
        {
            Debug.LogWarning("WARNING! Invalid shape in spawner.");
        }

        return(null);
    }
예제 #16
0
    public Shape SpawnShape()
    {
        Shape shape = null;

        shape = GetQueuedShape();
        shape.transform.position = transform.position;

        StartCoroutine(GrowShape(shape, transform.position, 0.25f));

        if (spawnFx)
        {
            spawnFx.Play();
        }

        if (shape)
        {
            return(shape);
        }
        else
        {
            Debug.Log("WARNING! Invalid shape in spawner!");
            return(null);
        }
    }
예제 #17
0
 private void SpawnParticle()
 {
     ParticlePlayer.Play(_Ids.GetRandom(), Random.insideUnitSphere * 5);
     ParticlePlayer.Play(_hashedFirst, Random.insideUnitSphere * 5);
 }
예제 #18
0
 private void SpawnFollowing()
 {
     ParticlePlayer.Play(_Ids.GetRandom(), follow: _Mover);
 }