Inheritance: MonoBehaviour
Exemplo n.º 1
0
    private void Awake()
    {
        FireController component = base.GetComponent <FireController>();

        component.AddOnTargetUpdateDelegate(new FireController.OnTargetUpdateDelegate(this.OnTargetUpdateDel));
        component.AddOnIdleUpdateDelegate(new FireController.OnIdleUpdateDelegate(this.OnTargetIdleUpdateDel));
    }
Exemplo n.º 2
0
    // 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;
        }
    }
Exemplo n.º 3
0
    //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));
        }
    }
Exemplo n.º 4
0
 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;
 }
Exemplo n.º 5
0
    //Control fire propagation
    IEnumerator FirePropagation(FireController fc)
    {
        yield return(new WaitForSeconds(burnTime > 0 ? burnTime * 0.1f : 0.01f));

        fc.enabled           = true;
        fireCollider.enabled = true;
    }
Exemplo n.º 6
0
    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);
    }
Exemplo n.º 7
0
    // 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];
    }
Exemplo n.º 8
0
 void Start()
 {
     moveControl        = GetComponent <MoveController>();
     fireControl        = GetComponent <FireController>();
     gm                 = GameObject.Find("GameManager").GetComponent <GameManager>();
     alive              = true;
     transform.position = Vector2.zero;
 }
Exemplo n.º 9
0
 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);
 }
Exemplo n.º 10
0
 // 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>();
 }
Exemplo n.º 11
0
 private void Awake()
 {
     numSticks         = 0;
     campfireComponent = CampFire.GetComponent <FireController>();
     torchComponent    = Torch.GetComponent <Torch>();
     anim       = GetComponent <Animator>();
     isSwinging = false;
     audio      = GetComponent <AudioSource>();
 }
Exemplo n.º 12
0
        // 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;
        }
Exemplo n.º 13
0
    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);
    }
Exemplo n.º 14
0
    // 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);
        }
    }
Exemplo n.º 15
0
    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)));
     }
 }
Exemplo n.º 17
0
	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> ();
 }
Exemplo n.º 19
0
 private void Start()
 {
     if (movementController == null)
     {
         movementController = GetComponent <MovementController> ();
     }
     if (fireController == null)
     {
         fireController = GetComponent <FireController> ();
     }
 }
Exemplo n.º 20
0
    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);
        }
    }
Exemplo n.º 21
0
 void OnParticleCollision(GameObject other)
 {
     if (other.tag == "Fire")
     {
         FireController controller = other.GetComponent <FireController>();
         if (controller.GetParent() != gameObject)
         {
             TakeDamage(controller.GetDamage());
             DestroyObject(other.gameObject);
         }
     }
 }
Exemplo n.º 22
0
 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>();
 }
Exemplo n.º 23
0
    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;
    }
Exemplo n.º 24
0
    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");
    }
Exemplo n.º 25
0
    // 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();
        }
Exemplo n.º 28
0
 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();
     }
 }
Exemplo n.º 29
0
    // 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";
    }
Exemplo n.º 30
0
    /// <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);
        }
    }
Exemplo n.º 31
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;
        }
Exemplo n.º 32
0
 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();
         }
     }
 }
Exemplo n.º 33
0
 void Start()
 {
     rigidBody = GetComponent<Rigidbody2D> ();
     fireController = GetComponent<FireController> ();
 }