Ejemplo n.º 1
0
    // 문을 명시적으로 잠든다. 디버그에서만 사용될 것 같으므로 앞에 "db"(debug)를 붙였다.
    public void     dbLock()
    {
        is_unlocked = false;

        this.setCreamVisible(!this.is_unlocked);

        if (this.moji_effect != null)
        {
            GameObject.Destroy(this.moji_effect.gameObject);
            this.moji_effect = null;
        }
    }
Ejemplo n.º 2
0
    // ================================================================ //
    // MonoBehaviour에서 상속.

    void    Awake()
    {
        this.mojis = new List <Moji>();

        foreach (var i in System.Linq.Enumerable.Range(0, this.transform.childCount))
        {
            Moji moji = new Moji();

            moji.go = this.transform.GetChild(i).gameObject;

            this.mojis.Add(moji);

            Color color = DoorMojiControl.HSVToRGB((float)i / (float)this.transform.childCount * 360.0f, 0.7f, 1.0f);

            moji.go.GetComponentInChildren <Renderer>().materials[0].SetColor("_MainColor", color);
        }

        // 문자순으로 정렬.
        this.mojis.Sort((x, y) => string.Compare(x.go.name, y.go.name));
    }
Ejemplo n.º 3
0
    public void             execute()
    {
        float healing_time = 2.0f;

        // ---------------------------------------------------------------- //
        // 다음 상태로 전환할지 체크한다].

        switch (this.step.do_transition())
        {
        case STEP.HEALING:
        {
            if (this.step.get_time() >= healing_time)
            {
                this.step.set_next(STEP.IDLE);
            }
        }
        break;
        }

        // ---------------------------------------------------------------- //
        // 상태 전환 시 초기화.

        while (this.step.get_next() != STEP.NONE)
        {
            switch (this.step.do_initialize())
            {
            case STEP.IDLE:
            {
                this.player.gameObject.setMaterialProperty("_BlendRate", 0.0f);
            }
            break;
            }
        }

        // ---------------------------------------------------------------- //
        // 각 상태에서의 실행 처리.

        switch (this.step.do_execution(Time.deltaTime))
        {
        case STEP.HEALING:
        {
            float h0, h1;
            float blend;
            float cycle = 2.0f;

            // 레인보우 컬러.
            {
                h0 = Mathf.Repeat(this.step.get_time(), cycle);
                h0 = h0 / cycle * 360.0f;
                h1 = h0 - 10.0f;
            }

            // 노멀 → 레인보우  → 노멀.
            {
                float t0 = 0.1f * healing_time;
                float t1 = 0.8f * healing_time;

                blend = Mathf.Repeat(this.step.get_time(), cycle);

                if (blend < t0)
                {
                    blend = Mathf.InverseLerp(0.0f, t0, blend);
                    blend = Mathf.Sin(Mathf.PI / 2.0f * blend);
                }
                else if (blend < t1)
                {
                    blend = 1.0f;
                }
                else
                {
                    blend = Mathf.InverseLerp(t1, healing_time * 1.0f, blend);
                    blend = Mathf.Lerp(0.0f, Mathf.PI, blend);
                    blend = Mathf.Cos(blend);
                    blend = Mathf.InverseLerp(-1.0f, 1.0f, blend);
                }
            }

            Color color0 = DoorMojiControl.HSVToRGB(h0, 1.0f, 1.0f);
            Color color1 = DoorMojiControl.HSVToRGB(h1, 1.0f, 1.0f);

            this.player.gameObject.setMaterialProperty("_SecondColor", color0);
            this.player.gameObject.setMaterialProperty("_ThirdColor", color1);
            this.player.gameObject.setMaterialProperty("_BlendRate", blend);
            this.player.gameObject.setMaterialProperty("_MaskAffection", 0.0f);
        }
        break;

        case STEP.CREAMY:
        {
            this.player.gameObject.setMaterialProperty("_SecondColor", Color.white);
            this.player.gameObject.setMaterialProperty("_ThirdColor", Color.white);
            this.player.gameObject.setMaterialProperty("_BlendRate", 0.9f);
            this.player.gameObject.setMaterialProperty("_MaskAffection", 1.0f);
        }
        break;

        case STEP.JINJIN:
        {
            float cycle = 1.0f;
            float rate  = ipCell.get().setInput(this.step.get_time())
                          .repeat(cycle).normalize().uradian().sin().lerp(0.2f, 0.5f).getCurrent();

            this.player.gameObject.setMaterialProperty("_SecondColor", Color.blue);
            this.player.gameObject.setMaterialProperty("_ThirdColor", Color.blue);
            this.player.gameObject.setMaterialProperty("_BlendRate", rate);
            this.player.gameObject.setMaterialProperty("_MaskAffection", 0.0f);
        }
        break;
        }
    }
Ejemplo n.º 4
0
	// 문을 명시적으로 잠든다. 디버그에서만 사용될 것 같으므로 앞에 "db"(debug)를 붙였다.
	public void	dbLock()
	{
		is_unlocked = false;

		this.setCreamVisible(!this.is_unlocked);

		if(this.moji_effect != null) {

			GameObject.Destroy(this.moji_effect.gameObject);
			this.moji_effect = null;
		}
	}