public void MeltIce()
    {
        if (this.gameObject.GetComponent <PhaseChange>() == null)
        {
            phaseChange = this.gameObject.AddComponent <PhaseChange>();
        }
        else
        {
            phaseChange = this.gameObject.GetComponent <PhaseChange>();
        }

        ElementType original = GetComponent <Element>().CurrentType;

        phaseChange.ChangePhase(original, ElementType.Water);

        ApplyTexturesAndPhysicsMats(ElementType.Water);


        if (this.gameObject.GetComponent <Element>().OriginalType == ElementType.Water)
        {
            newScale = this.gameObject.GetComponent <Element>().OriginalScale;
        }
        else
        {
            currentScale = transform.localScale;
            newScale     = currentScale + MeltExpansion;
        }
        StartTimer();
        StartCoroutine(Melt(newScale));
    }
Exemple #2
0
        public void StartGame()
        {
            PriorityCounter = 0;
            PhaseCounter    = 0;

            PlayerOne.DrawCards(7);
            PlayerTwo.DrawCards(7);

            AddStateAction(new PhaseAction(PhaseSequence[PhaseCounter]));
            PhaseChange?.Invoke(CurrentPhase);
            ContinueGame();
        }
Exemple #3
0
        public void ResolvePhaseAction(Phases phase)
        {
            //Increment phase counter and change turns if it surpasses Cleanup
            PhaseCounter++;
            if (PhaseCounter >= PhaseSequence.Count)
            {
                PhaseCounter = 0;
                swapTurns();
            }

            //Add the new phase to the stack and trigger PhaseChange
            AddStateAction(new PhaseAction(CurrentPhase));
            PhaseChange?.Invoke(CurrentPhase);
        }
    public void ReturnToIce()
    {
        if (this.gameObject.GetComponent <PhaseChange>() == null)
        {
            phaseChange = this.gameObject.AddComponent <PhaseChange>();
        }
        else
        {
            phaseChange = this.gameObject.GetComponent <PhaseChange>();
        }
        phaseChange.RevertChange();
        this.gameObject.GetComponent <Element>().SetOriginalScale();

        ApplyTexturesAndPhysicsMats(ElementType.Ice);
    }