void OnCollisionEnter(Collision other)
 {
     if (other.gameObject.name == "unitychan")
     {
         StoryScript.story_script(1);
     }
 }
Exemple #2
0
 void OnCollisionEnter(Collision other)
 {
     if (StatusScript.story == 0)
     {
         switch (other.gameObject.name)
         {
         case "Terrain":
             StoryScript.story_script(0);
             break;
         }
     }
 }
Exemple #3
0
    void OnCollisionEnter(Collision other)
    {
        if (other.gameObject.name == "unitychan")
        {
            if (StatusScript.story == 4)
            {
                StoryScript.story_script(4);
                PlayerScript.mode = 3;
                storyUI.GetComponent <Canvas> ().enabled = true;
                mes_into();
                StatusScript.story = 5;

                this.GetComponent <BoxCollider> ().isTrigger = true;
                PlayerPrefs.SetFloat("x", GameObject.Find("unitychan").transform.position.x);
                PlayerPrefs.SetFloat("y", GameObject.Find("unitychan").transform.position.y);
                PlayerPrefs.SetFloat("z", GameObject.Find("unitychan").transform.position.z);
                PlayerPrefs.SetFloat("rx", GameObject.Find("unitychan").transform.eulerAngles.x);
                PlayerPrefs.SetFloat("ry", GameObject.Find("unitychan").transform.eulerAngles.y);
                PlayerPrefs.SetFloat("rz", GameObject.Find("unitychan").transform.eulerAngles.z);
                PlayerPrefs.SetFloat("t", StatusScript.time);
                PlayerPrefs.SetInt("g", StatusScript.gameOver);
                PlayerPrefs.SetInt("lv", StatusScript.level);
                PlayerPrefs.SetInt("e", StatusScript.exp);
                PlayerPrefs.SetInt("mh", StatusScript.max_hp);
                PlayerPrefs.SetInt("h", StatusScript.hp);
                PlayerPrefs.SetInt("mm", StatusScript.max_mp);
                PlayerPrefs.SetInt("m", StatusScript.mp);
                PlayerPrefs.SetInt("a", StatusScript.attack);
                PlayerPrefs.SetInt("d", StatusScript.defence);
                PlayerPrefs.SetInt("s", StatusScript.speed);
                PlayerPrefs.SetInt("l", StatusScript.lack);
                for (int i = 0; i < 10; i++)
                {
                    if (StatusScript.item.Length > i)
                    {
                        PlayerPrefs.SetString("item" + i, StatusScript.item [i]);
                    }
                    else
                    {
                        PlayerPrefs.SetString("item" + i, "");
                    }
                    if (StatusScript.skil.Length > i)
                    {
                        PlayerPrefs.SetString("skil" + i, StatusScript.skil [i]);
                    }
                    else
                    {
                        PlayerPrefs.SetString("skil" + i, "");
                    }
                    if (StatusScript.magic.Length > i)
                    {
                        PlayerPrefs.SetString("magic" + i, StatusScript.magic [i]);
                    }
                    else
                    {
                        PlayerPrefs.SetString("magic" + i, "");
                    }
                }
                PlayerPrefs.SetInt("r", StatusScript.remagic);
                PlayerPrefs.SetInt("story", StatusScript.story);
                PlayerPrefs.SetInt("cave", StatusScript.cave);
                PlayerPrefs.Save();
            }
        }
    }