Exemplo n.º 1
0
    //public void OnGUI()
    //{
    //    int nbTwippies = GetAll<Twippie>().Count;
    //    GUI.Label(new Rect(Screen.width / 2 - 50, 10, 100, 20), "Twippies : " + nbTwippies.ToString());
    //}

    public void AddObject(ManageableObjet obj)
    {
        if (AllObjects.Contains(obj))
        {
            return;
        }

        AllObjects.Add(obj);
        //Debug.Log(obj.name + " ajouté à la liste globale");
    }
Exemplo n.º 2
0
    public void GenerateStatsForPanel(StatPanel panel, ManageableObjet obj)
    {
        Type t = obj.GetType();

        if (panel != null)
        {
            t.GetMethod("GenerateStats").Invoke(obj, new object[] { panel });
            //panel.StatManager.GenerateStat<ValueStat>(mainStat: true, name: "Amount").Populate(0, 0, 100, "Nombre de " + obj.Type.Split(' ')[0] + "s", true, "Amount");
            UpdateGlobalStat(panel, 1);
            panel.StatManager.GetStat("Amount").SetActive(false);
        }
    }
Exemplo n.º 3
0
 public void SetPreviewCam(ManageableObjet m)
 {
     EnablePreviewCam();
     _managedObject   = m;
     _managedRenderer = _managedObject.gameObject.GetComponent <Renderer>();
     if (_managedRenderer == null)
     {
         foreach (Transform child in m.transform)
         {
             _managedRenderer = child.gameObject.GetComponent <Renderer>();
         }
     }
 }
Exemplo n.º 4
0
    public T GenerateRadialAction <T>(ManageableObjet obj) where T : UserAction
    {
        var action = Instantiate(_objectGenerator.GetAction <T>());

        action.RadialButton.Parent = _objectManager.MainPlanet.MainRadial.transform;
        action.Type = obj.Type;
        action.transform.SetParent(action.RadialButton.Parent, false);
        action.RadialButton.Init();
        action.gameObject.SetActive(action.RadialButton.Active);
        action.SubMenu.SetActive(action.RadialButton.Active);
        action.RadialButton.Image.color = obj.Stats.Color;
        _objectManager.MainPlanet.MainRadial.Elements.Add(action);

        return(action);
    }
Exemplo n.º 5
0
 public void RemoveObject(ManageableObjet obj)
 {
     AllObjects.Remove(obj);
     //StatPanel statPanel = _og.MainPanel.StatPanels.FirstOrDefault(x => x.Type == obj.Type);
     //_og.MainPanel.UpdateGlobalStat(statPanel, -1);
 }