private void Awake() { FireController component = base.GetComponent <FireController>(); component.AddOnTargetUpdateDelegate(new FireController.OnTargetUpdateDelegate(this.OnTargetUpdateDel)); component.AddOnIdleUpdateDelegate(new FireController.OnIdleUpdateDelegate(this.OnTargetIdleUpdateDel)); }
// Update is called once per frame void Update() { FireController fc = GetComponent <FireController>(); if (Input.GetKeyDown("z")) { armsFiringRemaining = armsFiringDuration; } if (Input.GetKeyDown("x")) { clawsSparkingRemaining = clawsSparkingDuration; } armsFiringRemaining = armsFiringRemaining - Time.deltaTime; if (armsFiringRemaining > 0) { fc.armsFiring = true; } else { fc.armsFiring = false; } clawsSparkingRemaining = clawsSparkingRemaining - Time.deltaTime; if (clawsSparkingRemaining > 0) { fc.clawsSparking = true; } else { fc.clawsSparking = false; } }
//could have multiple particle effects, differing by shape of emitter //specify here based on shape og object //on start, set the size of the particle effect to the scale of the object //Spawn burning particle effect and cause disintegration private void OnEnable() { //spawn particle effect here if (burningParticleEffect != null) { pfx = Instantiate(burningParticleEffect, transform.position, transform.rotation, transform); pfx.transform.localScale = transform.localScale; AudioSource.PlayClipAtPoint(ignite, transform.position, Info.optionsData.sfxLevel); } if (burnTime > 0) { StartCoroutine(Disintegrate()); } else if (GetComponent <TorchTrigger>() != null) { GetComponent <TorchTrigger>().ToggleState(true); } FireController fc = GetComponent <FireController>(); if (fc != null) { StartCoroutine(FirePropagation(fc)); } }
public Block(Block block) { //TO DO: FINISH: this.ghost = block.ghost; this.id = block.id; this.name = block.name; this.mass = block.mass; this.showCollider = block.showCollider; //new objs this.objs = block.objs; //new icon this.icon = block.icon; //new properties this.properties = block.properties; //new colliders this.compoundCollider = block.compoundCollider; //new components this.components = block.components; //new needed resources this.neededResources = block.neededResources; //new adding points this.addingPoints = block.addingPoints; this.ignoreIntersectionForBase = block.ignoreIntersectionForBase; this.fireController = block.fireController; this.displayColliders = block.displayColliders; }
//Control fire propagation IEnumerator FirePropagation(FireController fc) { yield return(new WaitForSeconds(burnTime > 0 ? burnTime * 0.1f : 0.01f)); fc.enabled = true; fireCollider.enabled = true; }
public bool Stun() { if (waitingOnHit) { if (hit) { waitingOnHit = false; hit = false; stunCooldown = 3; return(true); } return(false); } animator.SetBool("Fire", true); AnimatorStateInfo clip = animator.GetCurrentAnimatorStateInfo(0); if (clip.IsName("Fire") && clip.normalizedTime > 0.80f) { Vector3 firePos = new Vector3(transform.position.x, transform.position.y + 1.5f, transform.position.z); GameObject fire = Instantiate(stunObject, firePos, transform.rotation); ds.PlaySoundScript("event:/Characters/Combat/Mage/char_mage_attack", 0, 0); waitingOnHit = true; FireController fireController = fire.GetComponent <FireController>(); fireController.SetTarget(player); fireController.SetParent(gameObject); fireController.SetCallbackObject(this); fireController.SetDamage((int)(entity.Stats.Attack * stunAttackMult)); fireController.Init(); animator.SetBool("Fire", false); } return(false); }
// Start is called before the first frame update void Start() { MaxHearts = GlobalDataScript.MaxAccelerant; CurrentHearts = GlobalDataScript.AccelerantInHand; MaxFireValue = GlobalDataScript.MaxHealth; PlayerObj.GetComponent <PlayerController>().MeleeDamage = GlobalDataScript.MeleeWeaponDmg; PlayerObj.GetComponent <PlayerController>().RangedDamage = GlobalDataScript.RangeWeaponDmg; //speed is handled in playercontroller start fadeWhiteGroup = FadeWhitePanel.GetComponent <CanvasGroup>(); fadeWhiteTextGroup = FadeWhiteTextPanel.GetComponent <CanvasGroup>(); fadeBlackGroup = FadeBlackPanel.GetComponent <CanvasGroup>(); fadeBlackTextGroup = FadeBlackTextPanel.GetComponent <CanvasGroup>(); fireController = FireObj.GetComponent <FireController>(); fireController.MaxValue = MaxFireValue; fireMeterController = FireMeterObj.GetComponent <FireMeterController>(); fireMeterController.MaxValue = MaxFireValue; FireValue = MaxFireValue; if (GlobalDataScript.Day >= 4) { AudioSource audio = GetComponent <AudioSource>(); audio.clip = audioBossMusic; audio.Play(); } Level level = LevelLoader.LoadLevel(Levels[GlobalDataScript.Day]); FindLastEnemySpawnTime(level); LaunchLevel(level); Egg.GetComponent <SpriteRenderer>().sprite = EggSprits[GlobalDataScript.Day]; }
void Start() { moveControl = GetComponent <MoveController>(); fireControl = GetComponent <FireController>(); gm = GameObject.Find("GameManager").GetComponent <GameManager>(); alive = true; transform.position = Vector2.zero; }
void Start() { audioSource = gameObject.AddComponent <AudioSource>() as AudioSource; audioSource.loop = true; audioSource.clip = fireClip; audioSource.Play(); fireController = GameObject.Find("MapManager").GetComponent <FireController>(); InvokeRepeating(nameof(AdjustSound), 0f, fireSoundUpdateInterval); }
// Use this for initialization void Start() { rigid = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); player = GameObject.Find("Player").transform; gm = GameObject.Find("GameManager").GetComponent <GameManager>(); playerFireControl = player.GetComponent <FireController>(); playerManager = player.GetComponent <PlayerManager>(); }
private void Awake() { numSticks = 0; campfireComponent = CampFire.GetComponent <FireController>(); torchComponent = Torch.GetComponent <Torch>(); anim = GetComponent <Animator>(); isSwinging = false; audio = GetComponent <AudioSource>(); }
// Init by copy public Target(Target otherTarget) { this.gameObject = otherTarget.gameObject; this.transform = otherTarget.transform; this.targetable = otherTarget.targetable; this.targetTracker = otherTarget.targetTracker; this.fireController = otherTarget.fireController; this.projectile = otherTarget.projectile; }
private void Awake() { this.tracker = this.GetComponent<TargetTracker>(); this.fireCtrl = this.GetComponent<FireController>(); this.tracker.AddOnPostSortDelegate(this.FilterTrackerTargetList); if (this.fireCtrl != null) this.fireCtrl.AddOnPreFireDelegate(this.FilterFireTargetList); }
// Start is called before the first frame update void OnTriggerEnter2D(Collider2D other) { FireController controller = other.GetComponent <FireController>(); print(controller); if (other.tag == "IcePlayer") { //print(other); } }
void Start() { maxTemp = 100; curTemp = 10; maxWater = 100; curWater = 100; _fc = FindObjectOfType <FireController>(); roomColor = GameObject.Find("RoomHeatColor").GetComponent <Image>(); }
public void StartPuttingoutFire(FireController fire) { if (player.GetPowerpackLevel() > 0 && fire != null) { canMove = false; isPlaying = true; fireToBePutOut = PutOutFire(fire); StartCoroutine(fireToBePutOut); StartCoroutine(StartWaterhose(fire.gameObject.transform.position + (Vector3.up / 2))); } }
public void Awake () { if (Instance) { Destroy(gameObject); return; } Instance = this; activeCells = new List<FireCell> (); depletedCells = new List<FireCell> (); }
public void Awake() { if (Instance) { Destroy(gameObject); return; } Instance = this; activeCells = new List <FireCell> (); depletedCells = new List <FireCell> (); }
private void Start() { if (movementController == null) { movementController = GetComponent <MovementController> (); } if (fireController == null) { fireController = GetComponent <FireController> (); } }
private void Awake() { this.tracker = this.GetComponent <TargetTracker>(); this.fireCtrl = this.GetComponent <FireController>(); this.tracker.AddOnPostSortDelegate(this.FilterTrackerTargetList); if (this.fireCtrl != null) { this.fireCtrl.AddOnPreFireDelegate(this.FilterFireTargetList); } }
void OnParticleCollision(GameObject other) { if (other.tag == "Fire") { FireController controller = other.GetComponent <FireController>(); if (controller.GetParent() != gameObject) { TakeDamage(controller.GetDamage()); DestroyObject(other.gameObject); } } }
void Start() { this._currentHealth = this.MaxHealth; this.UpdateHealthBar(); this.GetComponent <Rigidbody2D>().freezeRotation = true; this._sprite = GetComponent <SpriteRenderer>(); this._animator = GetComponent <Animator>(); this._movement = new Movement(this.transform, this._animator); this._movement.Speed *= 0.9f; this._pointFollower = new PointFollower(this.PointToFollow, this.Center, true); this._fireController = GetComponentInChildren <FireController>(); }
private void Start() { GameObject fireObject = GameObject.FindWithTag("Fire"); if (fireObject == null) { Debug.LogError("Please put a fire in the scene :3"); return; } _fireController = GameObject.FindWithTag("Fire").GetComponent <FireController>(); _soundManager = SoundManager.Instance; }
private void Awake() { rb = GetComponent <Rigidbody> (); campfireComponent = CampFire.GetComponent <FireController> (); torchComponent = Torch.GetComponent <Torch> (); anim = GetComponent <Animator> (); audio = GetComponent <AudioSource> (); tempRotationSpeed = rotationSpeed; inputBindings.Enable(); move = inputBindings.FindAction("Move"); interact = inputBindings.FindAction("Interact"); }
// Start is called before the first frame update void Start() { //animator = GetComponent<Animator>(); countParametersAnimator = animator.parameterCount; //animatorControllerParameters = new AnimatorControllerParameter[countParameters]; parameterNames = new string[countParametersAnimator]; parameterInformations = new string[countParametersAnimator]; countParameters = countParametersAnimator + variableTestInformations.Length; movementController = GetComponent <MovementController>(); inputController = GetComponent <InputController>(); fireController = GetComponent <FireController>(); }
IEnumerator PutOutFire(FireController fire) { while (isPlaying) { if (player.GetPowerpackLevel() > 0 || player.GetNumberPowerpacks() > 0) { if (fire != null) { fire.waterRequiredToExtinguish -= 0.05f; } player.UsePowerpack(); } yield return(new WaitForSeconds(0.3f)); } }
//进行相关变量初始化操作 private void initVar() { nextFirePoints = FireController.getInstance().findAllNearFirePoints(); nodes = FloorPlanManager.getInstance().getNodes(); queue.Clear(); int length = width * height; for (int i = 0; i < length; ++i) { distance[i] = INF; visit[i] = false; first[i] = -1; } caculateValue(); }
private void StartFire() { try { FireController.StartFire(); Console.WriteLine("The Fire was started"); ViewHelpers.Continue(); } catch (Exception e) { // TODO was a custom exception. Will need to be cleaned up Console.WriteLine("You can't start the fire without a match!"); ViewHelpers.Continue(); } }
// Use this for initialization void Start() { //TextUIを探す ResultUI = GameObject.Find("ResultText"); //結果を引っ張る int kill1 = FireController.getKill1(); int kill2 = FireController.getKill2(); int kill3 = FireController.getKill3(); int totalPoint = kill1 + (kill2 * 2) + (kill3 * 3); //結果を表示する this.ResultUI.GetComponent <Text>().text = "ちゃいろ:" + kill1 + "\nこげちゃ:" + kill2 + "\nくろ:" + kill3 + "\nごうけい:" + totalPoint + "point"; }
/// <summary> /// Substract The FireRate with a Parameter /// </summary> protected override void Effect() { player = GameObject.FindGameObjectWithTag("Player"); anim = player.GetComponent <Animator>(); anim.speed = anim.speed + upReload; fireController = player.GetComponent <FireController>(); if (fireController.GetFireRate() > 0.0f) { fireController.SetFireRate(fireController.GetFireRate() - upReload); } else { fireController.SetFireRate(0); } }
public virtual void ChangeFireControl(EntityAI ai) { FireController fireControl = ai.my.killingHandler.my.fireControl; VidyaMod.MatchTransform(fireControl.transform, Chicken.fireControl.transform); SphereCollider fireCollider = fireControl.myCollider as SphereCollider; FireController chickenFireControl = Chicken.fireControl; SphereCollider chickenFireCollider = chickenFireControl.myCollider as SphereCollider; fireCollider.center = chickenFireCollider.center; fireCollider.radius = chickenFireCollider.radius; fireControl.destroyTimer = chickenFireControl.destroyTimer; fireControl.randomAmount = chickenFireControl.randomAmount; fireControl.onFireDuration = chickenFireControl.onFireDuration; fireControl.fullFireDuration = fireControl.destroyTimer + fireControl.onFireDuration; }
protected void Start() { RefreshComponents(); if (transform.parent != BlockLoaderInfo.GetBlockPrefabsParent()) { if (transform.FindChild("FireTrigger")) { fireController = transform.FindChild("FireTrigger").GetComponent <FireController>(); } MonoStart(); if (transform.parent == Machine.Active().BuildingMachine) { BlockPlaced(); } } }
void Start() { rigidBody = GetComponent<Rigidbody2D> (); fireController = GetComponent<FireController> (); }