예제 #1
0
    void SpreadFire()
    {
        if (!this.isOnFire)
        {
            m_Shader.Fire(0f);
            return;
        }

        if (this.fireTimer?.ElapsedMilliseconds < 1000)
        {
            return;
        }

        SpawnFire();

        var target = this.halfAirlocks
                     .Where(al => al.isOpen && al.pairedAirlock.isOpen)
                     .Select(al => al.pairedAirlock.room)
                     .Where(room => !room.isOnFire).FirstOrDefault();

        if (target != null)
        {
            target.isOnFire  = true;
            target.fireTimer = Stopwatch.StartNew();
            m_Shader.Fire(1f);
        }
    }
예제 #2
0
    // Start is called before the first frame update
    void Start()
    {
        m_ShaderManip = GetComponent <ShaderManip>();
        m_ShaderManip.Fire(.5f);
        m_ShaderManip.Air(.5f);
        //m_Material = GetComponent<Renderer>().material;
        // Debug.Log(m_Material);
        //  Debug.Log(m_Material.GetFloat("OneForFire"));

        // m_Material.SetFloat("OneForFire", 1.0f);
        // Debug.Log(m_Material.GetFloat("OneForFire"));
    }