Пример #1
0
 /// <summary>
 /// Extinguishes fire on this instance of grass.
 /// </summary>
 public void Extinguish()
 {
     if (grassState == GrassState.burning)
     {
         grassState = GrassState.normal;
         UpdateGrassMaterial();
     }
 }
Пример #2
0
 /// <summary>
 /// Sets this instance of grass on fire.
 /// </summary>
 public void SetOnFire()
 {
     if (grassState != GrassState.burnt)
     {
         nextSpread = Random.Range(MIN_FIRE_SPREAD_TIME, MAX_FIRE_SPREAD_TIME);
         grassState = GrassState.burning;
         UpdateGrassMaterial();
     }
 }
Пример #3
0
        protected override void Update()
        {
            base.Update();
            // ===============================================
            // 転倒防止。 動くかは要確認
            // ===============================================
            var adjustRot = new Quaternion(0f, transform.rotation.y, 0f, transform.rotation.w);

            transform.rotation = adjustRot;

            currentState = stateMachine.CurrentState.identity;
        }
Пример #4
0
    void Update()
    {
        if (grassState == GrassState.burning && Simulation.PlayState == PlaybackState.play)
        {
            resistance -= Time.deltaTime * Simulation.PlaybackSpeed;
            nextSpread -= Time.deltaTime * Simulation.PlaybackSpeed;

            if (nextSpread <= 0)
            {
                SpreadFire();
                nextSpread = Random.Range(MIN_FIRE_SPREAD_TIME, MAX_FIRE_SPREAD_TIME);
            }

            if (resistance <= 0)
            {
                grassState = GrassState.burnt;
                UpdateGrassMaterial();
            }
        }
    }
Пример #5
0
    float nextSpread;                           // time until next spread

    /// <summary>
    /// Reset grass state, material and resistance.
    /// </summary>
    public void Start()
    {
        grassState = GrassState.normal;
        UpdateGrassMaterial();
        resistance = Random.Range(MIN_RESISTANCE_TIME, MAX_RESISTANCE_TIME);
    }
Пример #6
0
 public StateWander(T owner, GrassState identity) : base(owner, identity)
 {
 }
Пример #7
0
 public StatePause(T owner, GrassState identity) : base(owner, identity)
 {
 }
Пример #8
0
 public StateDestroy(T owner, GrassState identity) : base(owner, identity)
 {
 }
Пример #9
0
 public StatePursuit(T owner, GrassState identity) : base(owner, identity)
 {
 }
Пример #10
0
 public StateAttack(T owner, GrassState identity) : base(owner, identity)
 {
 }
Пример #11
0
 public StateEscape(T owner, GrassState identity) : base(owner, identity)
 {
 }
 public MyStateAttack(NigenigeGrass owner, GrassState identity) : base(owner, identity)
 {
 }
 public MyStateEscape(NigenigeGrass owner, GrassState identity) : base(owner, identity)
 {
 }
 public MyStateWander(NigenigeGrass owner, GrassState identity) : base(owner, identity)
 {
 }
 public MyStatePursuit(NigenigeGrass owner, GrassState identity) : base(owner, identity)
 {
 }
 public MyStateDestory(NigenigeGrass owner, GrassState identity) : base(owner, identity)
 {
 }