コード例 #1
0
    void checkContinuous(float progress)
    {
        if (isHitting() > 0.0f)
        {
            orbManager.AddScore(((progress - lastProgress) * score), player);
        }
        lastProgress = progress;

        /* else {
         *  orbManager.didFail ();
         *  Destroy (gameObject);
         * }*/
    }
コード例 #2
0
    // Update is called once per frame
    void Update()
    {
        //Debug.Log ("still update");

        if (inDetectionOrb && !isDoingMove)
        {
            isDoingMove = true;

            iTween.Stop(gameObject);

            iTween.ValueTo(gameObject, new Hashtable()
            {
                { "name", "checkStillMove" },
                { "from", 0.0f },
                { "to", 1.0f },
                { "time", (timeEndImpact - timeImpact) },
                { "onupdate", "checkStill" },
                { "oncomplete", "finishedMove" },
                { "oncompletetarget", gameObject },
            });
        }

        if (inDetectionOrb && isDoingMove)
        {
            if (isHitting() > 0.0f)
            {
                Debug.Log("still is hitting check");
                orbManager.AddScore(score / 30.0f, player);
                orbParticles.Play();
            }
        }
    }
コード例 #3
0
    // Update is called once per frame
    public virtual void Update()
    {
        //Debug.Log("<color=cyan>BEGIN HITTING</color>");
        if (inDetectionOrb)
        {
            if (orbManager.isSessionEnding)
            {
                return;
            }

            if (isHitting() > 0.0f)
            {
                //Debug.Log("Update:isHitting:true:"+gameObject.name);
                orbManager.AddScore(isHitting(), player);
                GetComponent <MeshRenderer> ().enabled = false;

                GetComponent <CircleCollider2D> ().enabled = false;

                // FFD added code nov 19 2016
                AuraControl ac = gameObject.GetComponentInChildren <AuraControl> ();
                if (ac != null)
                {
                    ac.AuraStop();
                }

                //ParticleSystem.MainModule pm = gameObject.GetComponentInChildren<ParticleSystem.MainModule>;
                //pm.maxParticles = 50;

                Transform child = transform.Find("VisibleSphere");
                if (child != null)
                {
                    child.GetComponent <MeshRenderer> ().enabled = false;
                    Debug.Log("visible Sphere mesh turned off");
                }
                Transform hotRotationContainer = transform.Find("HotRotationContainer");
                if (hotRotationContainer != null)
                {
                    hotRotationContainer.Find("HitRotationPointer").GetComponent <MeshRenderer> ().enabled = false;
                }
                //this.transform.Find ("HotRotationContainer").transform.Find ("HitRotationPointer").GetComponent<MeshRenderer> ().enabled = false;

                Transform hotRotationContainer2 = transform.Find("HotRotationContainer2");
                if (hotRotationContainer2 != null)
                {
                    hotRotationContainer2.Find("HitRotationPointer2").GetComponent <MeshRenderer> ().enabled = false;
                }



                inDetectionOrb = false;
                iTween.Stop(gameObject);

                ParticleSystem ps = orbParticles;
                ps.GetComponent <ParticleSystem>().maxParticles = Mathf.RoundToInt(isHitting() * 5.0f);

                //ps.main.maxParticles = Mathf.RoundToInt (isHitting () * 100.0f);
                orbParticles = ps;
                //int particlesIntensity = Mathf.RoundToInt(isHitting() * 100.0f);
                //orbParticles.main.maxParticles = particlesIntensity;

                orbParticles.Play();
                iTween.ValueTo(gameObject,
                               new Hashtable()
                {
                    { "name", "destroyCountdown" },
                    { "from", 0.0f },
                    { "to", 1.0f },
                    { "onupdate", "dummyUpdate" },
                    { "onupdatetarget", gameObject },
                    { "oncomplete", "destroyOrb" },
                    { "oncompletetarget", gameObject },
                    { "time", orbParticles.duration },
                });
            }
            else
            {
                //Debug.Log("Update:isHitting:false");
            }
        }
    }