Example #1
0
    // Use this for initialization
    void Awake()
    {
        inst = this;

        /*
         * inst.Structures[0] = (GameObject)Resources.Load("object/carrot");
         * inst.Structures[1] = (GameObject)Resources.Load("object/carrot2");
         * inst.Structures[2] = (GameObject)Resources.Load("object/carrotbasket");
         * inst.Structures[3] = (GameObject)Resources.Load("object/tree");
         * inst.Structures[4] = (GameObject)Resources.Load("object/bone");
         * inst.Structures[5] = (GameObject)Resources.Load("object/bonebig");
         * inst.Structures[6] = (GameObject)Resources.Load("object/wall");
         */
        inst.Structures[0]  = (GameObject)Resources.Load("object/chapter2_wall");
        inst.Structures[1]  = (GameObject)Resources.Load("object/chapter2_carrotbox");
        inst.Structures[2]  = (GameObject)Resources.Load("object/chapter2_carrotfield");
        inst.Structures[3]  = (GameObject)Resources.Load("object/chapter2_carrotshelf");
        inst.Structures[4]  = (GameObject)Resources.Load("object/chapter2_helmet");
        inst.Structures[5]  = (GameObject)Resources.Load("object/chapter2_philar");
        inst.Structures[6]  = (GameObject)Resources.Load("object/chapter2_pick2(big)");
        inst.Structures[7]  = (GameObject)Resources.Load("object/chapter2_soildum");
        inst.Structures[8]  = (GameObject)Resources.Load("object/chapter2_dumbull");
        inst.Structures[9]  = (GameObject)Resources.Load("object/chapter2_torchlight");
        inst.Structures[10] = (GameObject)Resources.Load("object/chapter2_wall");
        inst.Structures[11] = (GameObject)Resources.Load("object/chapter2_watchtower");
        inst.Structures[12] = (GameObject)Resources.Load("object/firefeather");
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        if (mesh_draw == true)
        {
            GetComponent <MeshFilter>().mesh = mesh;
            if (MapPos.GetY() == 0)
            {
                SetCol();
            }
        }
        else
        {
            GetComponent <MeshFilter>().mesh = null;
            Passable = false;
            if (MapPos.GetY() == 0)
            {
                SetCol();
            }
        }

        if (obj_id != 0)
        {
            obj = (GameObject)GameObject.Instantiate(Object_Manager.GetInst().FindObj(obj_id - 1));
            Vector3 v = transform.position;
            obj.transform.position = new Vector3(v.x, obj_y, v.z);
            if (obj_id - 1 == 4)
            {
                Passable = true;
            }
            else
            {
                Passable = false;
            }
        }
        if (mat_name == "soil")
        {
            GetComponent <Renderer>().material = mat1;
            default_matid = 1;
        }
        if (mat_name == "grass")
        {
            GetComponent <Renderer>().material = mat2;
            default_matid = 2;
        }
        if (mat_name == "fire")
        {
            GetComponent <Renderer>().material = mat3;
            default_matid = 3;
        }
        if (mat_name == "wood")
        {
            GetComponent <Renderer>().material = mat4;
            default_matid = 4;
            Passable      = true;
        }
        if (mat_name == "under")
        {
            GetComponent <Renderer>().material = mat5;
            default_matid = 5;
        }
    }