Ejemplo n.º 1
0
    public void ChangeModel()
    {
        int index = (int)aile.modelName;

        while (aile.modelName == (Model)index)
        {
            index = UnityEngine.Random.Range(0, 5);

            /*if(index == 4)
             * {
             *  index = 0;
             * }
             * else
             * {
             *  index++;
             * }*/
        }
        switch ((Model)index)
        {
        case Model.ZX:
            aile.DoChange(zxObj);
            currentModel = zxObj;
            aile         = currentModel.GetComponent <ZX>();
            break;

        case Model.FX:
            aile.DoChange(fxObj);
            currentModel = fxObj;
            aile         = currentModel.GetComponent <FX>();
            break;

        case Model.PX:
            aile.DoChange(pxObj);
            currentModel = pxObj;
            aile         = currentModel.GetComponent <PX>();
            break;

        case Model.LX:
            aile.DoChange(lxObj);
            currentModel = lxObj;
            aile         = currentModel.GetComponent <LX>();
            break;

        case Model.HX:
            aile.DoChange(hxObj);
            currentModel = hxObj;
            aile         = currentModel.GetComponent <HX>();
            break;

        default: break;
        }
    }
Ejemplo n.º 2
0
 void Start()
 {
     currentModel = zxObj;
     aile         = currentModel.GetComponent <ZX>();
 }