Esempio n. 1
0
    public void StartSkill()
    {
        if (endTarget == null)
        {
            return;
        }

        curState = SkillState.directionTarget;
        transform.LookAt(endTarget);
        isCollision   = false;
        startTimer    = Time.time;
        virtualTarget = startTarget.position;
        journeyLength = Vector3.Distance(startTarget.position, endTarget.position);
        isPlay        = true;
        StartCoroutine(UpdateSkill(0.016f));

        ShakeCamera shakeCamera = Camera.main.GetComponent <ShakeCamera>();

        if (shakeCamera != null)
        {
            if (ShakeCameraTime_Start > 0)
            {
                shakeCamera.Play(ShakeCameraTime_Start, ShakeCameraAmount_Start);
            }
        }
    }
Esempio n. 2
0
 void Update()
 {
     if (!isExploded)
     {
         isBurnabe             = (finish.position - transform.position).magnitude < 1.5f;
         isBurnableFromTrigger = Physics.CheckSphere(transform.position, 1f, burnableMask);
         Debug.Log(isBurnabe);
         Debug.Log(isBurnableFromTrigger);
         if (isBurnabe || fireStarted || isBurnableFromTrigger)
         {
             fireStarted         = true;
             countdownExplotion -= Time.deltaTime;
             if (countdownExplotion <= 0f)
             {
                 isExploded = true;
                 explotion.SetActive(true);
                 if (isBurnableFromTrigger)
                 {
                     explosionForce();
                 }
                 shaker.Play();
                 Invoke("setdefaultExplotion", 2f);
             }
             flame.SetActive(true);
         }
     }
 }
Esempio n. 3
0
    // Use this for initialization
    void Start()
    {
        Destroy(gameObject, TimeDestroy);
        ShakeCamera shakeCamera = Camera.main.GetComponent <ShakeCamera>();

        if (shakeCamera != null)
        {
            if (ShakeCameraTime > 0)
            {
                shakeCamera.Play(ShakeCameraTime, ShakeCameraAmount);
            }
        }
    }
Esempio n. 4
0
    private void Explosion()
    {
        ShakeCamera shakeCamera = Camera.main.GetComponent <ShakeCamera>();

        if (shakeCamera != null)
        {
            if (ShakeCameraTime_Explosion > 0)
            {
                shakeCamera.Play(ShakeCameraTime_Explosion, ShakeCameraAmount_Explosion);
            }
        }

        GameObject go = GameObject.Instantiate(explosionPrefab, otherCollision.transform.position, Quaternion.identity) as GameObject;

        Destroy(go, 2);
        // Vector3 addForce = ((endTarget.position - startTarget.position).normalized + Vector3.up * ForceHeight).normalized;

        //otherCollision.GetComponent<Rigidbody>().AddForce(addForce * Force);
        //curState = SkillState.None;
        Destroy(gameObject);
    }
Esempio n. 5
0
        public void OnShake(float time = 0.5f)
        {
            ShakeCamera cam = ShakeCamera.Get(m_camTransform.gameObject);

            cam.Play(time);
        }