예제 #1
0
    public static MisionSlot CreateComponent(GameObject where, MisionInfo _mision)
    {
        where.name = "Slot";
        where.SetActive(false);
        MisionSlot myC = where.AddComponent <MisionSlot>();

        myC.info = _mision;
        where.SetActive(true);
        return(myC);
    }
예제 #2
0
    public void ClaimMisionRedward(MisionInfo info)
    {
        int i = GameManager.Instance.GetWorldIndex(info.wname);

        if (info.completed && misionsPerWorld[i].Contains(info))
        {
            GameManager.Instance.SetGoldRedward(info.reward);
            MisionsPerWorld[i].Remove(info);
            SaveMisions();
        }
    }
예제 #3
0
    public Mision(MisionInfo info)
    {
        this.info = info;

        if (info.SubMisions.Count != 0)
        {
            for (int i = 0; i < info.SubMisions.Count; i++)//genero cantidad de misiones de a cuerdo a la dificultad
            {
                subMisionInfo subMision = info.SubMisions[i];
                subMisions.Add(new SubMision(subMision));
            }
        }

        Inventory.OnItemAdd += UpdateMisionProgres;
    }
예제 #4
0
 public Mision LoadMision()
 {
     if (GameManager.Instance.ActiveMision != null)
     {
         MisionInfo actvMsn = GameManager.Instance.ActiveMision;
         if (GameManager.Instance.SelectedWorld == GameManager.Instance.GetWorldInfo(actvMsn.wname))
         {
             return(new Mision(actvMsn));
         }
         else
         {
             WorldInfo actvWorld = GameManager.Instance.SelectedWorld;
             GameManager.Instance.ActiveMision = MisionManager.Instance.GetMisionFromWorld(actvWorld);
             return(new Mision(GameManager.Instance.ActiveMision));
         }
     }
     else
     {
         WorldInfo actvWorld = GameManager.Instance.SelectedWorld;
         GameManager.Instance.ActiveMision = MisionManager.Instance.GetMisionFromWorld(actvWorld);
         return(new Mision(GameManager.Instance.ActiveMision));
     }
 }