Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        totalTime += Time.deltaTime;
        //totalTime += Time.deltaTime;

        if (DEBUG_MODE)
        {
            Debug.Log("PHASE NAME\t" + nowPhase.name + "\tTIME :\t" + totalTime);
        }

        /// <summary>
        /// START페이즈나 READY페이즈 일 경우 타이머. 시간이 만료되면 다음 상태로 전이된다.
        /// </summary>
        if (nowPhase.Equals(START) || nowPhase.Equals(READY))
        {
            timeCounter += Time.deltaTime;

            if (timeCounter >= nowPhase.timeLimit)
            {
                timeCounter = 0f;

                if (nowPhase.Equals(START))
                {
                    nowPhase = READY;
                    Ready();
                }
                else if (nowPhase.Equals(READY))
                {
                    nowPhase = BATTLE;
                    Battle();
                }
            }
        }
        /// <summary>
        /// 전투 페이즈 시 웨이브 생성이 끝났고, 타겟팅 배열이 비어있을 경우 Ready상태로 이동.
        /// </summary>
        else if (nowPhase.Equals(BATTLE))
        {
            timeCounter += Time.deltaTime;

            if (waveController.IsWaveEnd() && IsTargettingClear())
            {
                timeCounter = 0f;
                nowPhase    = READY;
                Ready();
            }
        }
    }
        /// <summary>
        ///     Returns true if EntityUseUpgradeAction instances are equal
        /// </summary>
        /// <param name="other">Instance of EntityUseUpgradeAction to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(EntityUseUpgradeAction other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Phase == other.Phase ||
                     Phase.Equals(other.Phase)
                     ) &&
                 (
                     Type == other.Type ||
                     Type.Equals(other.Type)
                 ) &&
                 (
                     Upgrade == other.Upgrade ||
                     Upgrade.Equals(other.Upgrade)
                 ));
        }
Exemple #3
0
        /// <summary>
        /// Returns true if GamePhaseChangedEvent instances are equal
        /// </summary>
        /// <param name="other">Instance of GamePhaseChangedEvent to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(GamePhaseChangedEvent other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Phase == other.Phase ||

                     Phase.Equals(other.Phase)
                     ) &&
                 (
                     Step == other.Step ||
                     Step != null &&
                     Step.Equals(other.Step)
                 ) &&
                 (
                     Information == other.Information ||
                     Information != null &&
                     Information.Equals(other.Information)
                 ));
        }
Exemple #4
0
 protected override void EndProcessing()
 {
     if (Phase.Equals(Phases.End))
     {
         DoError();
     }
 }
Exemple #5
0
 protected override void BeginProcessing()
 {
     if (Phase.Equals(Phases.Begin))
     {
         DoError();
     }
 }
Exemple #6
0
    // Update is called once per frame
    void Update()
    {
        // Only apply movements when no other mode is turned on
        if (mode.Equals(Mode.None))
        {
            // When the Primary Mouse button is held down (Mouse Drag), then rotate the Molecule based on Mouse Movement
            if (phase.Equals(Phase.Adjust) && Input.GetMouseButton(0))
            {
                transform.Rotate(0, Input.GetAxis("Mouse X") * -rotationSpeed, 0, Space.World);
                transform.Rotate(Input.GetAxis("Mouse Y") * rotationSpeed, 0, 0, Space.World);
                resetAllBonds();
            }

            // Use the Mouse zoom input to move the molecule towards or away from the camera
            Vector3 curPos = transform.position;
            curPos.z          += Input.mouseScrollDelta.y * zoomSpeed;
            transform.position = curPos;
        }

        // Always reset the atom/bond buttons no matter what we clicked on
        if (Input.GetMouseButtonDown(0))
        {
            BondButton.resetBondButtons();
        }
    }
Exemple #7
0
 protected override void BeginProcessing()
 {
     if (!NoError.IsPresent)
     {
         WriteObject("begin");
     }
     if (Phase.Equals(Phases.Begin))
     {
         DoError();
     }
 }
Exemple #8
0
 protected override void EndProcessing()
 {
     if (!NoError.IsPresent)
     {
         WriteObject("end");
     }
     if (Phase.Equals(Phases.End))
     {
         DoError();
     }
 }
Exemple #9
0
 protected override void ProcessRecord()
 {
     if (Phase.Equals(Phases.Process))
     {
         DoError();
     }
     // write input object to pipeline for further processing
     if (Message != null)
     {
         WriteObject(Message);
     }
 }
Exemple #10
0
 protected override void ProcessRecord()
 {
     if (!NoError.IsPresent)
     {
         WriteObject("process");
     }
     if (Phase.Equals(Phases.Process))
     {
         DoError();
     }
     if (Message != null)
     {
         WriteObject(Message);
     }
 }
 void Update()
 {
     timer += Time.deltaTime;
     if (timer >= offset && !offsetCounted)
     {
         timer         = 0f;
         offsetCounted = true;
     }
     if (offsetCounted)
     {
         if (actualPhase.Equals(Phase.Growing))
         {
             float   ratio = timer / timeToGrow;
             Vector3 scale = maxScale * ratio;
             corePlanet.transform.localScale = scale;
             if (timer > timeToGrow)
             {
                 nextPhase();
             }
         }
         else if (actualPhase.Equals(Phase.WaitingGrown))
         {
             float ratio = timer / timeToStayMaxGrown;
             //Vector3 scale = maxScale * (ratio);
             if (timer > timeToStayMaxGrown)
             {
                 if (particleSystem != null)
                 {
                     particleSystem.Stop();
                 }
                 nextPhase();
             }
         }
         else if (actualPhase.Equals(Phase.Ungrowing))
         {
             float   ratio = timer / timeToGrow;
             Vector3 scale = maxScale * (1f - ratio);
             corePlanet.transform.localScale = scale;
             if (timer > timeToGrow)
             {
                 nextPhase();
             }
         }
         else if (actualPhase.Equals(Phase.WaitingUngrown))
         {
             float ratio = timer / timeToStayMinGrown;
             //Vector3 scale = maxScale * ratio;
             if (timer > timeToStayMinGrown)
             {
                 nextPhase();
             }
             else
             {
                 if (particleSystem != null)
                 {
                     if (timeToStayMinGrown - timer < 0.75f && !particleSystem.isPlaying)
                     {
                         particleSystem.Play();
                     }
                 }
             }
         }
     }
 }
Exemple #12
0
 public bool CanSelect()
 {
     return(CurrentPhase.Equals(Phase.SELECT));
 }