void Start() { // Initialize object to not follow mouse followUserMouse = false; Debug.Assert(mEggStat != null); globalBehavior = GameObject.Find("GameManager").GetComponent <GlobalBehavior>(); }
public float stunDuration = 5.0f; // in seconds // Use this for initialization void Start() { if (level1GameState == null) { level1GameState = GameObject.Find("GameManager").GetComponent <Level1GameState>(); } if (globalBehavior == null) { globalBehavior = FirstGameManager.TheGameState; } NewDirection(); if (mAbduct == null) { mAbduct = Resources.Load("Prefabs/AbductSplash") as GameObject; } if (hero == null) { hero = GameObject.Find("Hero") as GameObject; } renderer = GetComponent <SpriteRenderer>(); if (null != renderer) { spriteDefault = Resources.Load("Textures/enemyDefault", typeof(Sprite)) as Sprite; spriteStunned = Resources.Load("Textures/enemyStunned", typeof(Sprite)) as Sprite; spriteAfraid = Resources.Load("Textures/enemyAfraid", typeof(Sprite)) as Sprite; } state = stateType.Default; }
// Start is called before the first frame update void Start() { initX = transform.position.x; initY = transform.position.y; timeHit = 0; globalBehavior = GameObject.Find("GameManager").GetComponent <GlobalBehavior>(); }
public CheckoutDialog(Repository repository) { Verify.Argument.IsNotNull(repository, nameof(repository)); _repository = repository; InitializeComponent(); var inputs = new IUserInputSource[] { Revision = new TextBoxInputSource(_txtRevision), }; ErrorNotifier = new UserInputErrorNotifier(NotificationService, inputs); Text = Resources.StrCheckoutRevision; _lblRevision.Text = Resources.StrRevision.AddColon(); _lstReferences.Style = GitterApplication.DefaultStyle; _lstReferences.LoadData(_repository, ReferenceType.Reference, GlobalBehavior.GroupReferences, GlobalBehavior.GroupRemoteBranches); _lstReferences.Items[0].IsExpanded = true; _lstReferences.ItemActivated += OnReferencesItemActivated; GlobalBehavior.SetupAutoCompleteSource(_txtRevision, _repository, ReferenceType.Reference); GitterApplication.FontManager.InputFont.Apply(_txtRevision); _controller = new CheckoutController(repository) { View = this }; }
public void DispatchEvent(String type) { GlobalBehavior.RunInNextFrame(() => { _eventDispatcher.DispatchEvent(type); }); }
void Start() { if (global == null) { global = GameObject.Find("GlobalStateManager").GetComponent <GlobalBehavior>(); global.PrintCurrentLevel(); } periwinkle = GameObject.Find("PeriwinkleShip").GetComponent <Ship>(); orangeRed = GameObject.Find("OrangeRedShip").GetComponent <Ship>(); blue = GameObject.Find("PeriwinkleShip").GetComponent <Ship>(); chartreuse = GameObject.Find("OrangeRedShip").GetComponent <Ship>(); blueCity = GameObject.Find("BlueCity").GetComponent <VersusBaseBehavior>(); orangeCity = GameObject.Find("OrangeCity").GetComponent <VersusBaseBehavior>(); charCity = GameObject.Find("ChartreuseCity").GetComponent <VersusBaseBehavior>(); perCity = GameObject.Find("PeriwinkleCity").GetComponent <VersusBaseBehavior>(); status = GameObject.Find("Status").GetComponent <GUIText>(); controls = GameObject.Find("Controls").GetComponent <GUIText>(); controls.text = "1: Destroy Periwinkle ship" + "\n2: Destroy OrangeRed ship" + "\n3: Destroy Periwinkle city" + "\n4: Destroy OrangeRed city" + "\n5: Turn on ship invincibility" + "\n6: Turn on city invincibility" + "\nF1: Destroy all orbs" + "\nF2: Spawn more orbs" + "\nEnter: Reset scene" + "\nEscape: Return to main menu"; }
// Use this for initialization void Start() { GlobalBehavior.Setup(); SocketManager.Instance.AddEventListener(SocketEvent.CONNECT, OnConnect); SocketManager.Instance.Connect("127.0.0.1", 9201); }
void Start() { anim = GetComponent <Animator>(); myBody = GetComponent <Rigidbody2D>(); InteractionModel = GetComponent <CharacterInteractionModel>(); HideWeapon(); audio = gameObject.AddComponent <AudioSource>(); audio.playOnAwake = false; audio.volume = 0.8f; attackSounds = Resources.LoadAll("Sounds/AttacksBis"); pointsSound = Resources.LoadAll("Sounds/Coins"); hurtSound = Resources.Load("Sounds/Hurt"); shootSounds = Resources.LoadAll("Sounds/Shoot"); heartSound = Resources.Load("Sounds/heart"); wrongSound = Resources.Load("Sounds/wrong"); setFrozen(false, true); GlobalBehavior global = GameObject.FindGameObjectWithTag("Global").GetComponent <GlobalBehavior> (); if (SceneManager.GetActiveScene().name == "Level1") { global.initValue(); } maxHp = global.maxHpPlayer; damage = global.damagePlayer; moveSpeed = global.moveSpeedPlayer; InitPoint(global.scorePlayer); Debug.Log(maxHp); Debug.Log(damage); Debug.Log(moveSpeed); currentHp = maxHp; UpdateDisplayHearts(); }
protected static void CreateGlobalManager() { GameObject newGameState = new GameObject(); newGameState.name = "GlobalStateManager"; newGameState.AddComponent <GlobalBehavior>(); sTheGameState = newGameState.GetComponent <GlobalBehavior>(); }
public void Start() { globalBehavior = GameObject.Find ("GameManager").GetComponent<GlobalBehavior> (); if(mProjectile == null) mProjectile = Resources.Load ("Prefabs/deathRay") as GameObject; if(mBlast == null) mBlast = Resources.Load("Prefabs/blast") as GameObject; earth = new Vector3(0.01f,0.01f,0.0f); }
/// <summary>Create <see cref="CreateBranchDialog"/>.</summary> /// <param name="repository"><see cref="Repository"/> to create <see cref="Branch"/> in.</param> /// <exception cref="ArgumentNullException"><paramref name="repository"/> == <c>null</c>.</exception> public CreateBranchDialog(Repository repository) { Verify.Argument.IsNotNull(repository, nameof(repository)); _repository = repository; InitializeComponent(); Localize(); var inputs = new IUserInputSource[] { BranchName = new TextBoxInputSource(_txtName), StartingRevision = new ControlInputSource(_txtRevision), Checkout = new CheckBoxInputSource(_chkCheckoutAfterCreation), Orphan = new CheckBoxInputSource(_chkOrphan), CreateReflog = new CheckBoxInputSource(_chkCreateReflog), TrackingMode = new RadioButtonGroupInputSource <BranchTrackingMode>( new[] { Tuple.Create(_trackingDefault, BranchTrackingMode.Default), Tuple.Create(_trackingTrack, BranchTrackingMode.Tracking), Tuple.Create(_trackingDoNotTrack, BranchTrackingMode.NotTracking), }), }; ErrorNotifier = new UserInputErrorNotifier(NotificationService, inputs); SetupReferenceNameInputBox(_txtName, ReferenceType.LocalBranch); var logallrefupdates = _repository.Configuration.TryGetParameterValue(GitConstants.CoreLogAllRefUpdatesParameter); if (logallrefupdates != null && logallrefupdates == "true") { _chkCreateReflog.Checked = true; _chkCreateReflog.Enabled = false; } ToolTipService.Register(_chkCheckoutAfterCreation, Resources.TipCheckoutAfterCreation); ToolTipService.Register(_chkOrphan, Resources.TipOrphan); ToolTipService.Register(_chkCreateReflog, Resources.TipReflog); ToolTipService.Register(_trackingTrack, Resources.TipTrack); _txtRevision.References.LoadData( _repository, ReferenceType.Reference, GlobalBehavior.GroupReferences, GlobalBehavior.GroupRemoteBranches); _txtRevision.References.Items[0].IsExpanded = true; GitterApplication.FontManager.InputFont.Apply(_txtName, _txtRevision); GlobalBehavior.SetupAutoCompleteSource(_txtRevision, _repository, ReferenceType.Branch); _controller = new CreateBranchController(repository) { View = this }; }
// Use this for initialization void Start() { // initialize projectile spawning if (null == mProjectile) { mProjectile = Resources.Load("Prefabs/Egg") as GameObject; } mlastEggFire = Time.realtimeSinceStartup; mGameManager = GameObject.Find("GameManager").GetComponent <GlobalBehavior>(); }
// Use this for initialization void Start() { GlobalBehavior.sTheGlobalBehavior = this; // Singleton pattern #region world bound support mMainCamera = Camera.main; // This is the default main camera mWorldBound = new Bounds(Vector3.zero, Vector3.one); UpdateWorldWindowBound(); #endregion }
// Use this for initialization void Start() { // Find all the waypoints in the game waypoints = GameObject.FindGameObjectsWithTag("Waypoint"); // Make a reference to game manager globalBehavior = GameObject.Find("GameManager").GetComponent <GlobalBehavior>(); // Point the enemy towards an objective curDestination = 0; }
// Use this for initialization void Start() { Debug.Assert(mEggCountEcho != null); // make sure this is set up GlobalBehavior.sTheGlobalBehavior = this; // Singleton pattern #region world bound support mMainCamera = Camera.main; // This is the default main camera mWorldBound = new Bounds(Vector3.zero, Vector3.one); UpdateWorldWindowBound(); #endregion }
// Use this for initialization void Start() { NewDirection(); mGameManager = GameObject.Find("GameManager").GetComponent <GlobalBehavior>(); mHero = GameObject.Find("Hero").GetComponent <InteractiveControl>(); mRenderder = gameObject.GetComponent <SpriteRenderer>(); mState = EnemyState.Normal; mSpeed = kReferenceSpeed; mHits = 0; wasScary = false; }
void Start() { if (globalBehavior == null) { globalBehavior = FirstGameManager.TheGameState; } if (mSplash == null) { mSplash = Resources.Load("Prefabs/Splash") as GameObject; } }
private float kHeroRotateSpeed = 180f; // 90-degrees in 2 seconds #endregion // Use this for initialization void Start() { // initialize projectile spawning if (null == mProjectile) { mProjectile = Resources.Load("Prefabs/Laser") as GameObject; } if (globalBehavior == null) { globalBehavior = FirstGameManager.TheGameState;; } }
// Use this for initialization void Start() { spriteManager = new SpriteSheetManager(renderer.material, mRowOfSpriteElements, mColumnOfSpriteElements, mBlankPixelsToLeft, mBlankPixelsToRight, mBlankPixelsToTop, mBlankPixelsToBottom); spriteManager.SetSpriteAnimationAciton(stop); worldScript = GameObject.Find("GameManager").GetComponent<GlobalBehavior>(); eggPrefab = Resources.Load("Prefabs/Egg") as GameObject; }
void Start() { firstButton = GetComponentInChildren <Button>(); firstButton.Select(); if (GameObject.FindGameObjectWithTag("Player") != null) { transform.FindChild("NextButton").gameObject.SetActive(true); CharacterBehavior player = GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterBehavior> (); float temp = player.GetScore() * 100; if (temp > 95) { score = "S"; } else if (temp > 85) { score = "A"; } else if (temp > 75) { score = "B"; } else if (temp > 65) { score = "C"; } else { score = "D"; } transform.Find("scoreText").GetComponent <Text>().text = "Score : " + score; GlobalBehavior global = GameObject.FindGameObjectWithTag("Global").GetComponent <GlobalBehavior> (); global.maxHpPlayer = player.getMaxHp(); global.damagePlayer = player.getDamage(); global.moveSpeedPlayer = player.getMoveSpeed(); global.scorePlayer = player.getRecyclePoint(); global.nbUpgradeHp = Upgrades.Instance.levels [0]; global.nbUpgradeSpeed = Upgrades.Instance.levels [1]; global.nbUpgradeDamage = Upgrades.Instance.levels [2]; global.priceUpgradeHp = Upgrades.Instance.prices [0]; global.priceUpgradeSpeed = Upgrades.Instance.prices [1]; global.priceUpgradeDamage = Upgrades.Instance.prices [2]; } else { transform.FindChild("NextButton").gameObject.SetActive(false); transform.Find("scoreText").GetComponent <Text>().text = "Les déchets ont gagné"; } }
// Update is called once per frame void Update() { transform.position += (mSpeed * Time.smoothDeltaTime) * transform.up; GlobalBehavior globalBehavior = GameObject.Find("GameManager").GetComponent <GlobalBehavior>(); GlobalBehavior.WorldBoundStatus status = globalBehavior.ObjectCollideWorldBound(GetComponent <Renderer>().bounds); if (status != GlobalBehavior.WorldBoundStatus.Inside) { // Debug.Log("collided position: " + this.transform.position); NewDirection(); } }
void Awake() { myImage = GetComponent <Image>(); inventory = GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterInventoryModel>(); playerBehavior = GameObject.FindGameObjectWithTag("Player").GetComponent <CharacterBehavior>(); GlobalBehavior global = GameObject.FindGameObjectWithTag("Global").GetComponent <GlobalBehavior> (); prices = new int[] { global.priceUpgradeHp, global.priceUpgradeSpeed, global.priceUpgradeDamage }; levels = new int[] { global.nbUpgradeHp, global.nbUpgradeSpeed, global.nbUpgradeDamage }; Instance = this; audio = gameObject.AddComponent <AudioSource>(); audio.playOnAwake = false; audio.clip = (AudioClip)Resources.Load("Sounds/Buttons/woodenButton"); }
// Use this for initialization void Start() { Debug.Assert(mEggStat != null); Debug.Assert(enemy != null); GlobalBehavior.sTheGlobalBehavior = this; // Singleton pattern #region world bound support mMainCamera = Camera.main; // This is the default main camera screenBounds = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width, Screen.height, Camera.main.transform.position.z)); mWorldBound = new Bounds(Vector3.zero, Vector3.one); UpdateWorldWindowBound(); #endregion }
public void SyncExcute() { if (!HasType || !HasBody()) { GlobalBehavior.RunInNextFrame(OnExcuteOver); return; } MemoryStream stream = new MemoryStream(); stream.Write(_bytes, 0, _bytes.Length); stream.Position = 0; _instance = RuntimeTypeModel.Default.Deserialize(stream, null, _type); stream.Dispose(); GlobalBehavior.RunInNextFrame(OnExcuteOver); }
// Use this for initialization void Start() { if (level2GameState == null) { level2GameState = GameObject.Find("GameManager").GetComponent <BossBackground>(); } if (globalBehavior == null) { globalBehavior = FirstGameManager.TheGameState; } if (mAbduct == null) { mAbduct = Resources.Load("Prefabs/AbductSplash") as GameObject; } }
// Use this for initialization void Start() { mRB = GetComponent <Rigidbody2D>(); gm = GameObject.Find("Game Manager"); gb = gm.GetComponent <GlobalBehavior>(); rayCastLeft = GameObject.Find("ray_cast_left").GetComponent <raycastUp>(); rayCastRight = GameObject.Find("ray_cast_right").GetComponent <raycastUp>(); speedMultiplier = 1; gb.UpdateLandingText("Landing: In Air"); gb.UpdateTrickText("Trick: "); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: private boolean Process(boolean toStringFlag) throws java.sql.SQLException, java.io.IOException private bool Process(bool toStringFlag) { if (!this.runFlag_) { return(false); } if (this.category_ == 0L) { if (this.promptFlag_ == true) { GetPrompt(); } string line = null; if (this.inReader_ == null) { this.inReader_ = new System.IO.StreamReader(System.in, Encoding.UTF8); } line = this.inReader_.ReadLine(); if ((string.ReferenceEquals(line, null)) || (this.quitStrList_.Contains(line))) { return(false); } ProcessLine(line, toStringFlag); return(true); } string fs = GlobalBehavior.GetInstance().GetFieldSeparator(); string outStr = this.lexAccessApi_.GetResultStrByCategory(this.category_, this.showQuery_, this.query_, this.noOutputFlag_, this.noOutputMsg_, this.showTotalRecNum_, this.formatOpt_, fs); this.out_.Print(this.outWriter_, outStr, this.fileOutput_, toStringFlag); return(false); }
/// <summary>Create <see cref="CreateTagDialog"/>.</summary> /// <param name="repository"><see cref="Repository"/> to create <see cref="Tag"/> in.</param> /// <exception cref="ArgumentNullException"><paramref name="repository"/> == <c>null</c>.</exception> public CreateTagDialog(Repository repository) { Verify.Argument.IsNotNull(repository, "repository"); _repository = repository; InitializeComponent(); Localize(); var inputs = new IUserInputSource[] { _tagNameInput = new TextBoxInputSource(_txtName), _revisionInput = new ControlInputSource(_txtRevision), _messageInput = new TextBoxInputSource(_txtMessage), _annotatedInput = new RadioButtonInputSource(_radAnnotated), _signedInput = new RadioButtonInputSource(_radSigned), _useKeyIdInput = new RadioButtonInputSource(_radUseKeyId), _keyIdInput = new TextBoxInputSource(_txtKeyId), }; _errorNotifier = new UserInputErrorNotifier(NotificationService, inputs); SetupReferenceNameInputBox(_txtName, ReferenceType.Tag); _txtRevision.References.LoadData( _repository, ReferenceType.Reference, GlobalBehavior.GroupReferences, GlobalBehavior.GroupRemoteBranches); _txtRevision.References.Items[0].IsExpanded = true; GitterApplication.FontManager.InputFont.Apply(_txtKeyId, _txtMessage, _txtName, _txtRevision); GlobalBehavior.SetupAutoCompleteSource(_txtRevision, _repository, ReferenceType.Branch); if (SpellingService.Enabled) { _speller = new TextBoxSpellChecker(_txtMessage, true); } _controller = new CreateTagController(repository) { View = this }; }
private string GetLexRecords(string inTerm) { string resultStr = ""; string fs = GlobalBehavior.GetInstance().GetFieldSeparator(); if ((string.ReferenceEquals(inTerm, null)) || (inTerm.Length == 0)) { return(resultStr); } try { if (this.baseOpt_ == 0) { resultStr = this.lexAccessApi_.GetResultStrByTerm(inTerm, this.outCat_, this.showQuery_, this.query_, this.noOutputFlag_, this.noOutputMsg_, this.showTotalRecNum_, this.formatOpt_, fs); } else { resultStr = this.lexAccessApi_.GetResultStrByBase(inTerm, this.baseOpt_, this.outCat_, this.showQuery_, this.query_, this.noOutputFlag_, this.noOutputMsg_, this.showTotalRecNum_, this.formatOpt_, fs); } } catch (Exception e) { Console.Error.WriteLine("** ERR: " + e.Message); Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); } return(resultStr); }
// New direction will be something randomly within +- 45-degrees away from the direction // towards the center of the world // // To find an angle within +-45 degree of a direction: // 1. consider the simplist case of 45-degree above or below the x-direction // 2. we compute random.X: a randomly generate x-value between +1 and -1 // 3. To ensure within 45 degrees, we simply need to make sure generating a y-value that is within the (-random.X to +random.X) range // 4. Now a direction towards the (random.X, random.Y) is guaranteed to be within 45-degrees from x-direction // Apply the above logic, only now: // X-direciton is V (from current direciton towards the world center) // Y-direciton is (V.y, -V.x) // // Lastly, 45-degree is nice because X=Y, we can do this for any angle that is less than 90-degree private void NewDirection() { GlobalBehavior globalBehavior = GameObject.Find("GameManager").GetComponent <GlobalBehavior>(); // we want to move towards the center of the world Vector2 v = globalBehavior.WorldCenter - new Vector2(transform.position.x, transform.position.y); // this is vector that will take us back to world center v.Normalize(); Vector2 vn = new Vector2(v.y, -v.x); // this is a direciotn that is perpendicular to V float useV = 1.0f - Mathf.Clamp(mTowardsCenter, 0.01f, 1.0f); float tanSpread = Mathf.Tan(useV * Mathf.PI / 2.0f); float randomX = Random.Range(0f, 1f); float yRange = tanSpread * randomX; float randomY = Random.Range(-yRange, yRange); Vector2 newDir = randomX * v + randomY * vn; newDir.Normalize(); transform.up = newDir; }
void Start() { worldScript = GameObject.Find("GameManager").GetComponent<GlobalBehavior>(); explosion = Resources.Load("Prefabs/Explosion") as GameObject; Bounds bounds = worldScript.WorldBounds; Vector3 random = Random.insideUnitSphere; random.x *= bounds.size.x * 0.5f; // half of the size; random.z *= bounds.size.z * 0.5f; random.y = 0f; transform.position = random + bounds.center; speed = Random.value * 20f + 20f; normal = Resources.Load("Textures/normal") as Texture; run = Resources.Load("Textures/run") as Texture; stunned = Resources.Load("Textures/stunned") as Texture; stunCount = 0; gameObject.tag = "Enemy"; NewDirection(); }
// Use this for initialization void Start() { Debug.Assert(mLaserStat != null); Debug.Assert(mAstSpawn != null); //audioSource = GetComponent<AudioSource>(); GlobalBehavior.sTheGlobalBehavior = this; // Singleton pattern pauseObjects = GameObject.FindGameObjectsWithTag("ShowOnPause"); gameUI = GameObject.FindGameObjectsWithTag("GameUI"); hidePause(); foreach (GameObject g in gameUI) { g.SetActive(SceneManager.GetActiveScene().name == "MainScene"); } isPaused = !(SceneManager.GetActiveScene().name == "MainScene"); #region world bound support mMainCamera = Camera.main; // This is the default main camera mWorldBound = new Bounds(Vector3.zero, Vector3.one); UpdateWorldWindowBound(); #endregion //Time.timeScale = 0; }
// Use this for initialization void Start() { worldScript = GameObject.Find("GameManager").GetComponent<GlobalBehavior>(); splat = Resources.Load("Prefabs/Splat") as GameObject; }
// Use this for initialization void Start() { theGlobalBehavior = this; mMainCamera = Camera.main; EnemyBehavior.theHero = GameObject.Find ("Hero"); // World bound support mWorldBound = new Bounds(Vector3.zero, Vector3.one); UpdateWorldWindowBound(); for(int i = 0; i < 50; i++) { mEnemyToSpawn = Resources.Load("Prefabs/Enemy") as GameObject; GameObject e = (GameObject) Instantiate(mEnemyToSpawn); } // initialize enemy spawning ... if (null == mEnemyToSpawn) mEnemyToSpawn = Resources.Load("Prefabs/Enemy") as GameObject; }
void Start() { Debug.Assert(mEggStat != null); mGlobalBehavior = FindObjectOfType <GlobalBehavior>(); }
// Use this for initialization void Start() { if(globalBehavior == null) globalBehavior = GameObject.Find ("GameManager").GetComponent<GlobalBehavior> (); myState = EnemyState.FreeState; if (null == mProjectile) mProjectile = Resources.Load ("Prefabs/alienLaser") as GameObject; if (null == mblast) mblast = Resources.Load ("Prefabs/blast") as GameObject; NewDirection(); float tempX = UnityEngine.Random.Range (-Screen.width*2, Screen.width*2); if(tempX > -55 && tempX < 55) tempX += 10*Math.Sign(tempX); float tempY = UnityEngine.Random.Range (-Screen.height*2, Screen.height*2); if(tempY > -55 && tempY < 55) tempY += 10*Math.Sign(tempY); transform.position = new Vector3 (UnityEngine.Random.Range (-415, 415), UnityEngine.Random.Range (-185, 185), 0.0f); initial = false; away = new Vector3 (); }