public void drawModel()
    {
        if (nowPainterOutData!=null && !drawTimer)
        {
            if (nowPainterOutData.haveModelData)
            {
                createObject(nowPainterOutData);
            }
            else
            {
                //modelPainterProcessor = GetComponent<FlatModelCreator>();

                modelPainterProcessor.picture = nowPainterOutData.modelImage.resource;
                modelPainterProcessor.thickness = 1.0f;
                drawTimer = gameObject.AddComponent<zzCoroutineTimer>();
                drawTimer.setImpFunction(stepDrawModel);

            }
        }
    }
    void Start()
    {
        startSupply = gameObject.AddComponent<StartSupply>();
        startSupply.planeToCreate = plane;
        startSupply.initSupplyObjectFunc = initSupplyObject;

        if(zzCreatorUtility.isHost())
        {
            zzIndexTable    lItemTypeTable = zzItemSystem.getSingleton().getItemTypeTable();
            foreach (var lAwardItemInfo in awardItemInfoes)
            {
                randomItemID.addRandomObject(
                    lItemTypeTable.getIndex(lAwardItemInfo.nameOfAwardItem),
                    lAwardItemInfo.weigth);
            }

            //IDOfAwardItem = .getIndex(nameOfAwardItem);
            timer = gameObject.AddComponent<zzCoroutineTimer>();
            timer.setInterval(nextTakeoffTime);
            timer.setImpFunction(takeoff);

        }
    }
示例#3
0
    void Start()
    {
        if (!zzCreatorUtility.isHost())
        {
            Destroy(this);
            return;
        }

        //寻路的计时器
        pathTimer = gameObject.AddComponent<zzCoroutineTimer>();
        pathTimer.setInterval(pathSearchInterval);
        pathTimer.setImpFunction(this.pathUpdate);

        //行为更新的计时器
        actionCommandTimer = gameObject.AddComponent<zzTimer>();
        actionCommandTimer.setInterval(actionCommandUpdateInterval);
        actionCommandTimer.addImpFunction(this.actionCommandUpdate);

        //广范围探测追踪(敌人)的计时器
        zzCoroutineTimer lFollowDetectorTimer = gameObject.AddComponent<zzCoroutineTimer>();
        lFollowDetectorTimer.setInterval(followDetectIterval);
        lFollowDetectorTimer.setImpFunction(this.detectFollowed);

        if (!actionCommandControl)
            actionCommandControl = gameObject.GetComponentInChildren<ActionCommandControl>();

        AIStart();

        //产生第一个命令
        if (enable)
        {
            pathUpdate();
            actionCommandUpdate();
        }
    }