Пример #1
0
 public static UIControler GetInstance()
 {
     if (mInstance == null)
     {
         mInstance = new UIControler();
     }
     return(mInstance);
 }
Пример #2
0
 void InitBrush()
 {
     uiControler = GameObject.FindObjectOfType <UIControler>();
     for (int i = 0; i < brushTexture.Length; i++)
     {
         uiControler.addBrush((Texture2D)brushTexture[i], i);
     }
 }
Пример #3
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != null)
     {
         ErrorLogger.LogErrorInFile("Error in UIControler");
         Destroy(gameObject);
     }
 }
Пример #4
0
    // Use this for initialization
    void Awake()
    {
        float h, s, v;

        Color.RGBToHSV(TheColor, out h, out s, out v);
        //Debug.Log("HSV = " + v.ToString() + "," + h.ToString() + "," + v.ToString() + ", color = " + TheColor.ToString());
        MyPlane = new Plane(transform.TransformDirection(Vector3.forward), transform.position);
        RPoints = new Vector3[3];
        SetTrianglePoints();
        TMesh       = Triangle.GetComponent <MeshFilter>().mesh;
        uiControler = GameObject.FindObjectOfType <UIControler>();
        SetNewColor(TheColor);
    }
Пример #5
0
 /// <summary>
 /// Instancira se prazan Player objekat i dodeljuju reference za sve komponente
 /// </summary>
 void Awake()
 {
     player    = new Player();
     localDB   = GameObject.Find("LocalDBControler").GetComponent <LocalDBControler>();
     firebase  = GameObject.Find("FirebaseControler").GetComponent <FirebaseControler>();
     ui        = GameObject.Find("UIControler").GetComponent <UIControler>();
     fb        = GameObject.Find("FacebookControler").GetComponent <FacebookControler>();
     ads       = GameObject.Find("AdsControler").GetComponent <AdsControler>();
     purchaser = GameObject.Find("Purchaser").GetComponent <Purchaser>();
     social    = GameObject.Find("SocialControler").GetComponent <SocialControl>();
     score     = GameObject.Find("ScoreControler").GetComponent <ScoreControl>();
     gift      = GameObject.Find("RewardControler").GetComponent <RewardControl>();
 }
Пример #6
0
    void Awake()
    {
        Animator = this.GetComponent <Animator>();

        if (this.name == "Transitions")
        {
            DontDestroyOnLoad(this);
        }

        GameObject Manager = GameObject.Find("ManagerHolder");

        GM        = Manager.GetComponent <GameMng>();
        Controler = Manager.GetComponent <UIControler>();
    }
Пример #7
0
 public void Creation(int[] v1, float[][] v2, float[][][] v3, UIControler userInterface, int s1)
 {
     Gen      = userInterface;
     LastPos  = this.transform.position;
     StartPos = new Vector3[InputInformation.Length];
     StartRot = new Quaternion[InputInformation.Length];
     for (int i = 0; i < InputInformation.Length; i++)
     {
         StartPos[i] = InputInformation[i].transform.position;
         StartRot[i] = InputInformation[i].transform.localRotation;
     }
     input         = new float[InputInformation.Length + OutputBone.Length + 3 + 3 + 3 + 2];
     blockade      = new float[OutputBone.Length];
     neuralNetwork = new NeutralNetwork(v1, v2, v3, s1);
     ChoseColor();
 }
    void Start()
    {
        do
        {
            dir = Random.Range(-1, 1);
        } while(dir == 0);

        if (dir == -1)
        {
            transform.Rotate(0, 180, 0);
        }

        rb           = GetComponent <Rigidbody2D>();
        scoreManager = FindObjectOfType <ScoreManager>();
        uIControler  = FindObjectOfType <UIControler>();
        animator     = GetComponent <Animator>();
    }
Пример #9
0
    //Awake is always called before any Start functions
    void Awake()
    {
        //Check if instance already exists
        if (instance == null)
        {
            //if not, set instance to this
            instance = this;
        }

        //If instance already exists and it's not this:
        else if (instance != this)
        {
            //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
            Destroy(gameObject);
        }

        //Sets this to not be destroyed when reloading scene
        DontDestroyOnLoad(gameObject);
    }
Пример #10
0
 public void Creation(int[] layerShema, UIControler mana)
 {
     Gen      = mana;
     LastPos  = this.transform.position;
     StartPos = new Vector3[InputInformation.Length];
     StartRot = new Quaternion[InputInformation.Length];
     for (int i = 0; i < InputInformation.Length; i++)
     {
         StartPos[i] = InputInformation[i].transform.position;
         StartRot[i] = InputInformation[i].transform.localRotation;
     }
     input         = new float[InputInformation.Length + OutputBone.Length + 3 + 3 + 3 + 2];
     layerShema[0] = input.Length;
     layerShema[layerShema.Length - 1] = OutputBone.Length;
     blockade      = new float[OutputBone.Length];
     neuralNetwork = new NeutralNetwork(layerShema);
     ChoseColor();
     active = true;
 }
Пример #11
0
        public override bool Purshase(ShopDefItem item, int quantity)
        {
            bool ret = true;

            Fields.currentShopOwner = RelatedFaction;
            if (!Fields.shopItemsSold.ContainsKey(item.ID))
            {
                PurchasedItem pItem = new PurchasedItem();
                pItem.ID             = item.ID;
                pItem.Count          = quantity;
                pItem.Cost           = UIControler.GetPrice(item) * quantity;
                pItem.TransactionId  = PersistentMapClient.getBMarketId();
                pItem.remainingFunds = PersistentMapClient.companyStats.GetValue <int>("Funds");
                Fields.shopItemsSold.Add(item.ID, pItem);
            }
            else
            {
                Fields.shopItemsSold[item.ID].Count         += quantity;
                Fields.shopItemsSold[item.ID].Cost          += UIControler.GetPrice(item) * quantity;
                Fields.shopItemsSold[item.ID].remainingFunds = PersistentMapClient.companyStats.GetValue <int>("Funds");
            }
            try
            {
                if (Web.PostBuyItems(Fields.shopItemsSold, RelatedFaction, isBlackMarket))
                {
                    UIControler.DefaultPurshase(this, item, quantity);
                }
                else
                {
                    ret = false;
                }
            }
            catch (Exception e)
            {
                PersistentMapClient.Logger.LogError(e);
                ret = false;
            }
            Fields.shopItemsSold = new Dictionary <string, Objects.PurchasedItem>();
            needsRefresh         = true;
            return(ret);
        }
Пример #12
0
 void Awake()
 {
     gameOver        = false;
     gameNeedRestart = false;
     ui_controller   = FindObjectOfType <UIControler>();
 }
Пример #13
0
 void Awake()
 {
     _instance = this;
     PopUpUI (UITAG.UI_MainMenu);
 }
Пример #14
0
 public static bool Prefix()
 {
     UIControler.RefreshColors(UIControler.ActiveShop);
     return(false);
 }
Пример #15
0
 void Start()
 {
     diamonds   = PlayerPrefs.GetInt("diamonds", 0);
     uiCotroler = FindObjectOfType <UIControler>();
 }
Пример #16
0
 // Start
 private void Start()
 {
     uiControler = GetComponent <UIControler>();
     mainUpdate  = FindObjectOfType <MainUpdate>();
 }
 // Use this for initialization
 void Start()
 {
     currentSpawnTime = 0.0f;
     audioS           = GetComponent <AudioSource>();
     uiControl        = FindObjectOfType <UIControler>();
 }
Пример #18
0
        public static bool BeginShop(SG_Shop_Screen __instance)
        {
            UIControler.InitShopWindow(__instance);

            return(false);
        }