Exemple #1
0
 void End()
 {
     CombatInfo.CombatsFinished = 0;
     MapNodeManager.ResetGame();
     Debug.Log(CombatInfo.CombatsFinished);
     SceneManager.LoadScene("MainMenu");
 }
Exemple #2
0
        public void ActivateNode(GameObject other)
        {
            MapNodeManager mapNodeManager = MapNodeManager.GetInstance();

            //node activation
            if (mapNodeManager != null && other != null)
            {
                if (other.GetComponent <MapPlayerController>() != null && GameState.GetInstance().ReadyToBattle)
                {
                    if (nodeState == NodeState.Start ||
                        (nodeState == NodeState.Incomplete &&
                         MapNodeList.nodes[previusIndex].nodeState == NodeState.Current))
                    {
                        SaveGameManager.SaveGame(other.transform.position, CombatInfo.CombatsFinished);

                        if (nodeState != NodeState.Start)
                        {
                            MapNodeList.nodes[previusIndex].spriteRenderer.color = completeNormalColor;
                            MapNodeList.nodes[previusIndex].nodeState            = NodeState.Complete;
                        }

                        spriteRenderer.color = currentNormalColor;
                        nodeState            = NodeState.Current;

                        //get combat info from the gameobject sprite render is on
                        Combat combat = spriteRenderer.gameObject.GetComponent <Combat>();
                        if (combat != null)
                        {
                            //node based fight info
                            if (previusIndex == 1)
                            {
                                CombatInfo.FightType = 1;
                            }

                            if (previusIndex == -1)
                            {
                                CombatInfo.Env = Environment.Grass;
                            }
                            else
                            {
                                CombatInfo.Env = Environment.City;
                            }

                            GameObject.FindObjectOfType <FadeOut>().Fade(combat);
                        }
                    }
                }
            }
        }
 public void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     for (int i = 0; i < CombatInfo.CombatsFinished; i++)
     {
         Debug.Log(MapNodeList.nodes[i].nodeName);
         Debug.Log(MapNodeList.nodes[i].nodeState);
         MapNodeList.nodes[i].nodeState = NodeState.Complete;
         MapNodeList.nodes[i].CheckSp();
     }
     if (CombatInfo.CombatsFinished > 0)
     {
         MapNodeList.nodes[CombatInfo.CombatsFinished - 1].nodeState = NodeState.Current;
         MapNodeList.nodes[CombatInfo.CombatsFinished].nodeState     = NodeState.Incomplete;
     }
     else
     {
         ResetGame();
     }
 }
Exemple #4
0
 void Awake()
 {
     Instance          = this;
     m_transMainCanvas = GameObject.Find("MainCanvas/Main").transform;
 }