//新功能 void NewFunction(string btn, int id) { LevelLock info = LevelLockProvider.Instance.GetDataById(id); functionName = btn; string labelStr = info.m_Note; string picName = ""; label.text = StrTools(752, info.m_Note); switch (btn) { case "Entrance-Pve": picName = "fb"; break; case "Entrance-Mail": picName = "youjian"; break; case "Entrance-Trial": picName = "huodong"; break; case "Entrance-Match": picName = "tz"; break; case "Entrance-Friend": picName = "friends"; break; case "Entrance-Equipment": picName = "zhuangbei"; break; case "Entrance-Skill": picName = "jneng"; break; case "Entrance-Partner": picName = "chuzhan"; break; case "Entrance-XHun": picName = "Xhun"; break; case "Entrance-GodEquip": picName = "shenqi"; break; } SetIcon(picName, fuctionIcon); fuctionLabel.text = labelStr; }
//按钮排序 int ButtonSort(LevelLock button1, LevelLock button2) { if (button1.m_Order < button2.m_Order) { return(-1); } else if (button1.m_Order > button2.m_Order) { return(1); } return(-1); }
public void SetEquipment(ChangeNewEquip cne) { LevelLock info = LevelLockProvider.Instance.GetDataById(16); RoleInfo role = LobbyClient.Instance.CurrentRole; if (info.m_Level > role.Level) { return; } if (cne != null) { id = cne.id; propertyid = cne.propertyid; ItemConfig ic = ItemConfigProvider.Instance.GetDataById(id); if (ic != null) { UnityEngine.Transform tf = transform.Find("bc/goods/Texture"); if (tf != null) { UITexture ut = tf.gameObject.GetComponent <UITexture>(); if (ut != null) { UnityEngine.Texture tt = GamePokeyManager.GetTextureByPicName(ic.m_ItemTrueName); if (tt != null) { ut.mainTexture = tt; } } } tf = transform.Find("bc/goods"); if (tf != null) { UISprite us = tf.gameObject.GetComponent <UISprite>(); if (us != null) { us.spriteName = "EquipFrame" + ic.m_PropertyRank; } } } UIManager.Instance.ShowWindowByName("DynamicEquipment"); } }
public Form1() { InitializeComponent(); brain = new Brain(); NeuronProperties np = new NeuronProperties(brain.GetNeuron()); np.ShowDialog(); brain.DefaultNeuron.Logic = new NeuronLogic(NeuronLogic.Algorithm.analog); brain.DefaultNeuron.min = -256; brain.DefaultNeuron.max = 256; brain.DefaultNeuron.threshold = 0; Neuron n1 = brain.GetNeuron("n1"); n1.Logic = new Oscillator(1000); n1.threshold = 0; #if asdfasdf Neuron n2 = brain.GetNeuron("n2"); Synapse s1 = brain.GetSynapse("s1"); Neuron n3 = brain.GetNeuron("n3"); Neuron n4 = brain.GetNeuron("n4"); Synapse s2 = brain.GetSynapse("s2"); // try and use just the + operator alone... // fails ( ie, expression with no meaning ) // n2 + s2 + n1 + s1 + n2; // manually link with external synapse... //n2 += s1 += n1 += s2 += n2; // automatically pull a synapse to link these n2 += n1 += n2; LevelLock l1 = new LevelLock(brain); FlipFlop f1 = new FlipFlop(brain); f1 += n3; n4 += f1; //n3.threshold = -50; n3.Log(); n4.Log(); n3.Logic = new NeuronLogic(NeuronLogic.Algorithm.digital); #endif while (true) { brain.cycle++; n1.Log(); #if asdfasdf n3.Log(); n4.Log(); f1.Log(); //n3.threshold = -50; if (n3.threshold < 0) { n3.threshold = 50; } else { n3.threshold = -50; } #endif } #if asdfasdf Console.WriteLine("N3 = " + (int)n3); Console.WriteLine("N4 = " + (int)n4); brain.cycle++; Console.WriteLine("N3 = " + (int)n3); Console.WriteLine("N4 = " + (int)n4); brain.cycle++; Console.WriteLine("N3 = " + (int)n3); Console.WriteLine("N4 = " + (int)n4); brain.cycle++; Console.WriteLine("N3 = " + (int)n3); Console.WriteLine("N4 = " + (int)n4); brain.cycle++; Console.WriteLine("N3 = " + (int)n3); Console.WriteLine("N4 = " + (int)n4); brain.cycle++; Console.WriteLine("N3 = " + (int)n3); Console.WriteLine("N4 = " + (int)n4); n3.threshold = 50; brain.cycle++; Console.WriteLine("N3 = " + (int)n3); Console.WriteLine("N4 = " + (int)n4); brain.cycle++; Console.WriteLine("N3 = " + (int)n3); Console.WriteLine("N4 = " + (int)n4); brain.cycle++; Console.WriteLine("N3 = " + (int)n3); Console.WriteLine("N4 = " + (int)n4); brain.cycle++; Console.WriteLine("N3 = " + (int)n3); Console.WriteLine("N4 = " + (int)n4); brain.cycle++; Console.WriteLine("N3 = " + (int)n3); Console.WriteLine("N4 = " + (int)n4); brain.cycle++; Console.WriteLine("N3 = " + (int)n3); Console.WriteLine("N4 = " + (int)n4); n3.threshold = -50; brain.cycle++; Console.WriteLine("N3 = " + (int)n3); Console.WriteLine("N4 = " + (int)n4); brain.cycle++; Console.WriteLine("N3 = " + (int)n3); Console.WriteLine("N4 = " + (int)n4); brain.cycle++; Console.WriteLine("N3 = " + (int)n3); Console.WriteLine("N4 = " + (int)n4); brain.cycle++; Console.WriteLine("N3 = " + (int)n3); Console.WriteLine("N4 = " + (int)n4); brain.cycle++; Console.WriteLine("N3 = " + (int)n3); Console.WriteLine("N4 = " + (int)n4); brain.cycle++; Console.WriteLine("N3 = " + (int)n3); Console.WriteLine("N4 = " + (int)n4); for (int xx = 0; xx < 100; xx++) { brain.cycle = xx; Console.WriteLine("output n1 = " + (int)n1); Console.WriteLine("output n2 = " + (int)n2); } Console.WriteLine("output n1 = " + (int)n1); Console.WriteLine("output n2 = " + (int)n2); #endif //Point[] atest = new Point[256]; //atest[500] = new Point( 10, 10 ); }
//------------------------------------------------------------------------------------------------ // Singleton //------------------------------------------------------------------------------------------------ // Make this game object and all its transform children // survive when loading a new scene. private void Awake() { //set the screen orientation. We do this in ZombiePasser since it exists in //every screen. This is untested and needs to be tried in an apk. -Andrew //Screen.orientation = ScreenOrientation.Portrait; //never mind we can do this in player settings if (Application.platform == RuntimePlatform.WindowsPlayer) { Screen.SetResolution(640, 1136, false); } // extract level JSON file here: levelData = Camera.main.GetComponent <LevelReader>(); levelsList = levelData.getLevels(); // Generate Level Icons: GameObject levelSelection = GameObject.FindGameObjectWithTag("LevelSelection"); GameObject IconRef = GameObject.FindGameObjectWithTag("LevelIcon"); iconRefs.Add(IconRef); MainMenuManager mainMenu = GameObject.FindGameObjectWithTag("mainCanvas").GetComponent <MainMenuManager> (); float scalarX = GameObject.FindGameObjectWithTag("mainCanvas").GetComponent <RectTransform> ().localScale.x; float scalarY = GameObject.FindGameObjectWithTag("mainCanvas").GetComponent <RectTransform> ().localScale.y; float iconWidth = IconRef.GetComponent <RectTransform> ().rect.width; //Debug.Log (iconWidth); float xDiff = scalarX * (iconWidth * 1.05f); float yDiff = scalarY * (iconWidth * 1.4f); float yOffset = 0.0f; float chapterFlag = 0.0f; float chapterSeperationSpace = scalarY * (iconWidth * 3.4f); int counter = 1; for (int i = 0; i < 10; i++) { float xOffset = 0.0f; for (int j = 0; j < 5; j++) { if (!(i == 0 && j == 0)) { // create individual level icon with new positions, onclick functions, names. Vector3 newPosition = new Vector3(IconRef.transform.position.x + xOffset, IconRef.transform.position.y + yOffset, IconRef.transform.position.z); GameObject newIconRef = Instantiate(IconRef, newPosition, Quaternion.identity, levelSelection.transform); newIconRef.name = counter.ToString(); LevelLock levelLock = newIconRef.GetComponent <LevelLock> (); int levelParameter = counter; newIconRef.GetComponent <Button> ().onClick.RemoveAllListeners(); newIconRef.GetComponent <Button>().onClick.AddListener(() => { levelLock.loadLevel(); //mainMenu.updateLevelNum (levelParameter); //mainMenu.loadScene("main"); }); iconRefs.Add(newIconRef); } xOffset += xDiff; counter++; } // control the y offset spacing for levels by chapter chapterFlag++; if (chapterFlag == 2) { chapterFlag = 0.0f; yOffset -= chapterSeperationSpace; } else { yOffset -= yDiff; } xOffset = xDiff; } Load(); // keep zombie awake: DontDestroyOnLoad(this); if (FindObjectsOfType(GetType()).Length > 1) { Destroy(gameObject); } }
void Awake() { try { object eo; eo = ArkCrossEngine.LogicSystem.EventChannelForGfx.Subscribe("ge_ui_unsubscribe", "ui", UnSubscribe); if (eo != null) { eventlist.Add(eo); } eo = ArkCrossEngine.LogicSystem.EventChannelForGfx.Subscribe <int>("ge_user_levelup", "property", UserLevelUP); if (eo != null) { eventlist.Add(eo); } //buttons.Clear(); //buttons.Add(btnMars.gameObject); //buttons.Add(btnArena.gameObject); LevelLock levelLockCfg = LevelLockProvider.Instance.GetDataById(c_MarsUnlockLevelId); if (levelLockCfg != null) { m_MarsUnlockLevel = levelLockCfg.m_Level; } levelLockCfg = LevelLockProvider.Instance.GetDataById(c_ArenaUnlockLevelId); if (levelLockCfg != null) { m_ArenaUnlockLevel = 60; // m_ArenaUnlockLevel = levelLockCfg.m_Level; } List <GowTimeConfig> timeCfgs = GowConfigProvider.Instance.GowTimeConfigMgr.GetData(); string marsOpenTime = "00:00-24:00"; if (timeCfgs.Count >= (int)GowTimeConfig.TimeTypeEnum.MatchTime) { //设置战神赛开赛时间 GowTimeConfig openTimeCfg = timeCfgs[(int)GowTimeConfig.TimeTypeEnum.MatchTime - 1]; if (openTimeCfg != null /* && lblMarsOpenTime!=null*/) { int startHour = openTimeCfg.m_StartHour; marsOpenTime = string.Format("{0}:{1:d2}-{2}:{3:d2}", openTimeCfg.m_StartHour, openTimeCfg.m_StartMinute, openTimeCfg.m_EndHour, openTimeCfg.m_EndMinute ); //lblMarsOpenTime.text = openTime; } } if (btnMars != null) { TrialUnit unit = btnMars.GetComponent <TrialUnit>(); if (unit != null) { unit.SetLblLock(m_MarsUnlockLevel); unit.SetLblTime(marsOpenTime); } } if (btnArena != null) { TrialUnit unit = btnArena.GetComponent <TrialUnit>(); if (unit != null) { unit.SetLblLock(m_ArenaUnlockLevel); } } //buttons.Sort(SortByLv); CheckHasTip(); } catch (System.Exception ex) { ArkCrossEngine.LogicSystem.LogFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace); } }
private int GetUnlockLevelById(int id) { LevelLock data = LevelLockProvider.Instance.GetDataById(id); return(null != data ? data.m_Level : 1); }