Пример #1
0
    //设置自身执行步骤
    public void SetStep(int targetstep, InstallSpeed _ins = InstallSpeed.slowspeed, bool issingle = false)
    {
//		Debug.Log (Name+"执行步骤::::"+targetstep );
        Stack <RealObj> rstack = new Stack <RealObj>();

        if (issingle)
        {
            targetstep = this.step + targetstep;
            if (targetstep > this.step)
            {
                realstack = PushToStack(targetstep - 1, this.step - 1);
            }
            else
            {
                realstack = PushToStack(targetstep, this.step);
            }
        }
        else
        {
            if (targetstep > this.step)
            {
                realstack = PushToStack(targetstep - 1, this.step - 1);
            }
            else
            {
                realstack = PushToStack(targetstep, this.step);
            }
            UImanager.GetInstance.SetOtherButtonDisable(false);
        }
        if (realstack.Count == 0)
        {
            return;
        }

        RealObj re = realstack.Pop();



        //Debug.Log("现在步数"+step+">>>>>>共推出多少个元素???"+realstack.Count+"第一次退出:::::"+re.name);
        re.Excute(targetstep >= this.step, _ins, ModelMoveEnd);
        if (issingle)
        {
            re.Spark();
        }
    }
Пример #2
0
    //回调执行
    private void ModelMoveEnd(int aspeacket, InstallSpeed ins)
    {
        step += aspeacket;
//		Debug.Log ("有没有执行步骤添加?"+ step);
        if (realstack.Count > 0)
        {
            RealObj re = realstack.Pop();
            lastobj = re;
            re.Excute(aspeacket > 0, ins, ModelMoveEnd);
        }
        else
        {
            if (lastobj != null)
            {
                CameraBess.GetInstance.ChoiseCamera(false, new PathObjects(lastobj.transform.position, lastobj.transform.eulerAngles));
            }
            UImanager.GetInstance.SetOtherButtonDisable();
            mapcontroll.SetAllChildActive(true);
            LimitStep();
            // NextModelSparking(aspeacket);
        }
    }
Пример #3
0
    //装
    public void Excute(bool _isexcute, InstallSpeed inspeed, Action <int, InstallSpeed> act = null)
    {
        IsExcute         = _isexcute;
        selfinstallspeed = inspeed;
        switch (inspeed)
        {
        //手动改变安装速度
        case InstallSpeed.slowspeed:
        case InstallSpeed.heigherspeed:
            if (gameObject.name == "RAJ1减速机")
            {
                Debug.Log("<><><><><");
            }

            selfdamping = UImanager.GetInstance.SlowSpeed;
            state       = cameramoveing;
            break;

        case InstallSpeed.fasterspeed:

            if (gameObject.name == "RAJ1减速机")
            {
                Debug.LogError("<><>父父父<><><");
            }

            if (gameObject.name == "RA151.99x3.53O型圈")
            {
                Debug.Log("<><>子子子<><><");
            }

            selfdamping = fasterspeed;
            if (_isexcute)
            {
                currentWayPoint       = 2;
                transform.position    = path[currentWayPoint].position;
                transform.eulerAngles = path [currentWayPoint].eulerangel;
            }
            else
            {
                currentWayPoint       = 0;
                transform.position    = path[currentWayPoint].position;
                transform.eulerAngles = path [currentWayPoint].eulerangel;
                if (gameObject.name == "151.99x3.53O型圈")
                {
                    Debug.Log(transform.localPosition);
                    //   transform.localPosition = new Vector3(1.12892f,-0.0149f,-8.9127f);
                }
            }
            switch (gameObject.name)
            {
            case "AS568 O形圈151.99x3.53-DC_Shell":
                transform.localPosition = new Vector3(0, -0.0156f, 0);
                break;

            case "151.99x3.53O型圈":
                transform.localPosition = new Vector3(0, -0.01f, 0);
                break;

            default:
                break;
            }
            CameraBess.GetInstance.ChoiseCamera(true, camepath);
            break;

        default:
            break;
        }
        move_end = act;
    }