void Start() { character = soldier.character2D; jumpJetEffectzzTimer = gameObject.AddComponent<zzTimer>(); jumpJetEffectzzTimer.setInterval(jumpJetTime); jumpJetEffectzzTimer.addImpFunction(OffJumpJetEffect); jumpJetEffectzzTimer.enabled = false; }
public void init() { characterController = character.characterController; timer = gameObject.AddComponent<zzTimer>(); timer.addImpFunction(OnActionEnd); timer.enabled = false; _inActing = false; if (characterAnimation) animationState = characterAnimation[animationName]; }
void Start() { if(zzCreatorUtility.isHost()) { updateTimer = gameObject.AddComponent<zzTimer>(); if (race == Race.eNone) updateTimer.enabled = false; else occupied(race); updateTimer.addImpFunction(updateStronghold); } }
void Awake() { if (Network.isClient) { disappearTimer = gameObject.AddComponent<zzTimer>(); disappearTimer.setInterval(disappearTime); disappearTimer.addImpFunction(disappear); setLifeEndEvent(); disappearEvent = zzUtilities.nullFunction; } else Destroy(this); }
void Start() { if (stunSucceedEvent==null) { stunSucceedEvent = zzUtilities.nullFunction; } if (stunFailEvent == null) { stunFailEvent = zzUtilities.nullFunction; } timer = gameObject.AddComponent<zzTimer>(); timer.setInterval(0.05f); timer.addImpFunction(updateTransaction); timer.enabled = false; }
protected override void initWhenHost() { fireTimer = gameObject.AddComponent<zzTimer>(); fireTimer.addImpFunction(fireAndSetNextTime); fireTimer.setInterval(getIntervalAndMove()); }
/// <summary> /// 切换(开启 关闭)狙击模式 /// </summary> /// <param name="sSniper">狙击器</param> /// <param name="sHero">英雄</param> public void changeSniper(GameObject sSniper,GameObject sHero) { if (!sniperBool) { //print("开"); sniperBool = true; sniperObject = sSniper; heroObject = sHero; Vector3 v3 = new Vector3(heroObject.transform.position.x,heroObject.transform.position.y,-10f); targetTemp = cameraFollow.target; cameraFollow.target = null; amplificationTime.enabled = true; if (!smoothT) { smoothT=mainCamera.AddComponent<smooth>(); } #warning 更改 rectHeight = Screen.height * 4; rectWidth = rectHeight; vReticle.y= (Screen.height - rectHeight) / 2; vReticle.x = (Screen.width - rectWidth) / 2; Vector3 vTemp = new Vector3(); vTemp = vReticle; smoothT.target = vTemp; smoothT.local = vReticle; smoothT.mainCamera = mainCamera; shootTime = gameObject.AddComponent<zzTimer>(); shootTime.setInterval(sniperObject.GetComponent<SniperEntrance>().getSniperData().interval); shootTime.addImpFunction(shootBoolFunction); shootTime.enabled = false; } }
// Use this for initialization void Start() { //找到System对象 if (!SystemObject) { SystemObject = GameObject.Find("System"); } //找到摄像机 if (!(mainCamera && cameraT)) { mainCamera = GameObject.Find("Main Camera"); cameraT = mainCamera.GetComponent<Camera>(); } //找到_2DCameraFollow组件 if (!cameraFollow) { cameraFollow = mainCamera.GetComponent<_2DCameraFollow>(); } amplificationTime = gameObject.AddComponent<zzTimer>(); amplificationTime.setInterval(intervalNumber); amplificationTime.addImpFunction(amplification); amplificationTime.enabled = false; reduceTime = gameObject.AddComponent<zzTimer>(); reduceTime.setInterval(intervalNumber); reduceTime.addImpFunction(reduce); reduceTime.enabled = false; // mainCamera.GetComponent<StartSupply>().startSupplyPlane(5.0f,-150.0f,-80.0f,0.0f,8.0f); }
void Start() { timer = gameObject.AddComponent<zzTimer>(); timer.setInterval(interval); timer.addImpFunction(createObject); }
void Start() { actionCommandTimer = gameObject.AddComponent<zzTimer>(); actionCommandTimer.setInterval(actionCommandUpdateInterval); actionCommandTimer.addImpFunction(fireDetect); nowAim = adversaryBase; UpdateCommand(); }
void Start() { waveTimer = gameObject.AddComponent<zzTimer>(); waveTimer.setInterval(waveCreatedInterval); waveTimer.addImpFunction(createWave); if (zzCreatorUtility.isHost()) { attackTimer = gameObject.AddComponent<zzTimer>(); attackTimer.setInterval(attackInterval); //zTimer.setImpFunction(My); attackTimer.addImpFunction(Attack); } else attackTimer = waveTimer; fireTimer = gameObject.AddComponent<zzTimer>(); fireOff(timeOffset); }
//void _toGetItemBagID() //{ // zzItemBagControl itemBagControl = hero.GetComponent<zzItemBagControl>(); // itemBagID = itemBagControl.getBagID(); //} //function _theHeroDead() //创建只能在服务器端调用 void _rebirthHero(Life p) { if (!haveFirstCreate) Debug.LogError("haveFirstCreate == false"); //if (HeroBelongToThePlayer()) //{ // //释放之前的输入 // _releaseControl(hero); //} _createHeroRebirthClock(); //重生的延迟执行 rebirthTimer = gameObject.AddComponent<zzTimer>(); rebirthTimer.addImpFunction(_rebirthHeroCreate); rebirthTimer.setInterval(rebirthTime); //if(Network.peerType !=NetworkPeerType.Disconnected) // GameObject lHeroObject = Network.Instantiate(heroPrefab,transform.position,Quaternion(),0); //haveFirstCreate = true; }
void RPCCreateHeroRebirthClock() { rebirthClockTimer = gameObject.AddComponent<zzTimer>(); rebirthClockTimer.addImpFunction(_updateRebirthTimeLeave); rebirthClockTimer.setInterval(1.0f); rebirthClockUI.setVisible(true); rebirthTimeLeave = rebirthTime; rebirthClockUI.setText(rebirthTimeLeave.ToString()); }
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(); } }
void hideObject() { renderObject.SetActiveRecursively(false); showRenderObjectTimer = gameObject.AddComponent<zzTimer>(); showRenderObjectTimer.addImpFunction(showObject); showRenderObjectTimer.setInterval(hideTime); }