예제 #1
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     StateReciever.SetState(States.INACTIVE);
     transitionCamera.GetComponent <CameraSplice>().enabled = true;
     particle.Play();
     gameObject.SetActive(false);
 }
예제 #2
0
 private void LateUpdate()
 {
     if (StateReciever.GetState() == States.INACTIVE)
     {
         return;
     }
     position += Input.GetAxisRaw("Horizontal") * changeAmount;
     position  = Mathf.Clamp(position, -maxValue, maxValue);
 }
예제 #3
0
 void FixedUpdate()
 {
     if (StateReciever.GetState() == States.INACTIVE)
     {
         return;
     }
     GetInput();
     Move();
     Jump();
 }
예제 #4
0
파일: Attack.cs 프로젝트: talios0/3-Colors
 void Update()
 {
     if (StateReciever.GetState() == States.INACTIVE)
     {
         return;
     }
     if (attackTracker == AttackTracker.IDLE && Input.GetAxisRaw("Attack") != 0)
     {
         Shoot();
     }
 }
예제 #5
0
 void LateUpdate()
 {
     if (particleSystem.isPlaying)
     {
         Vector3 screenPoint = Camera.main.WorldToViewportPoint(UIElement.transform.position);
         if (screenPoint.x > horizontalPosition - range && screenPoint.x < horizontalPosition + range)
         {
             //Camera.main.enabled = false;
             //newCamera.enabled = true;
             //this.enabled = false;
             StateReciever.SetState(States.ACTIVE);
             SceneChanger.ChangeScene("Level1");
         }
     }
 }
예제 #6
0
파일: Attack.cs 프로젝트: talios0/3-Colors
 void FixedUpdate()
 {
     if (StateReciever.GetState() == States.INACTIVE)
     {
         return;
     }
     if (attackTracker == AttackTracker.RELOAD)
     {
         if (reloadTracker > reloadTime)
         {
             reloadTracker = 0;
             attackTracker = AttackTracker.IDLE;
         }
         else
         {
             reloadTracker++;
         }
     }
 }
예제 #7
0
 private void FixedUpdate()
 {
     if (runInstance > runTimes)
     {
         mask.SetActive(false);
         image.SetActive(false);
         StateReciever.SetState(States.ACTIVE);
         this.enabled = false;
         return;
     }
     timeRunning++;
     if (timeRunning >= maxTime)
     {
         runInstance++;
         mask.GetComponent <RectTransform>().position = startPos;
         mask.GetComponent <Rigidbody2D>().velocity   = Vector2.zero;
         timeRunning = 0;
     }
     mask.GetComponent <Rigidbody2D>().AddForce(force * Mathf.Clamp(timeRunning / 30, 0, 1) * forceMultiplierOverTime, ForceMode2D.Force);
 }