public override void OnStartServer() { GameObject go = MonoBehaviour.Instantiate(checkObj, transform.position, Quaternion.identity) as GameObject; NetworkServer.Spawn(go); myserverLogic = go.GetComponent<serverLogic>(); go = MonoBehaviour.Instantiate(myCam, new Vector3(0,2.5f,-2.0f), Quaternion.identity) as GameObject; NetworkServer.Spawn(go); go = MonoBehaviour.Instantiate(myUltiCam, new Vector3(0, 2.5f, 2.0f), Quaternion.identity) as GameObject; NetworkServer.Spawn(go); int tempNum = Random.Range(0, allEnvironment.Length); go = MonoBehaviour.Instantiate(allEnvironment[tempNum], new Vector3(0, 0,0), Quaternion.identity) as GameObject; NetworkServer.Spawn(go); Debug.Log("start server"); base.OnStartServer(); // StartCoroutine(myserverLogic.countDown(7)); }
public void startCountDown() { myserverLogic = GameObject.Find("server logic(Clone)").GetComponent<serverLogic>(); //StartCoroutine(countDown()); }
// Use this for initialization protected virtual void Awake() { mycustomNetworkManager = GameObject.Find("networkController").GetComponent<customNetworkManager>(); currentHealth = startingHealth; currentMana = startingMana; playerArrow = transform.Find("arrow parent").gameObject; myblockController = transform.Find("block").GetComponent<blockController>(); myUltiCamera = GameObject.FindGameObjectWithTag("ultimateCamera").GetComponent<ultimateCameraControllerNetwork>(); mymelee = transform.Find("melee trigger box").GetComponent<meleeNetwork>(); myaudio = GetComponent<AudioSource>(); rb = GetComponent<Rigidbody>(); isJumping = false; hasEnterGameOver = false; isAttack = false; isCastMode = false; playBlockAnimation = false; isLose = false; canMove = true; isWalking = false; isInResult = false; canCastUltimate = true; isPSActive = false; isPSArmor = false; isPSOTU = false; armorUICD = false; isNotEnoughMana = false; isKnockBack = true; isEndOfRangeAttack = true; isFinishCombo = true; isStun = false; isCrouch = false; canCombo = false; shouldWaitAnimationFinish = false; isBlocking = false; isDoubleTap = false; canRangeAttack = true; canMeleeAttack = true; speed = normalSpeed; jumpSpeed = lowJumpSpeed; // comboCount = 0; highestComboAchieve = 0; blockCount = maxBlockCount; stunRate = 1;//default spellCoolDownRate = 1;//how fast the spell cooldown, 1 is normal rate spellCoolDownRateNetwork = spellCoolDownRate; myserverLogic = GameObject.Find("server logic(Clone)").GetComponent<serverLogic>(); coolDownRangeTimer = 0; myDamageMultipler = 1; coolDownMeleeTimer = new float[2]; coolDownMeleeTimer[0] = coolDownMeleeAttackRate; isMeleeComboCount = new bool[3]; for (int i = 0; i < isMeleeComboCount.Length; i++) isMeleeComboCount[i] = false;//for melee combo animation myblockTimer = coolDownBlockTimer; stunTimer = coolDownStunRate; //comboText = combo.GetComponent<Text>(); //comboAnimation = combo.GetComponent<Animation>(); spellComboArmor = new float[3]; spellComboActive = new float[3]; spellComboPassive = new float[3]; for (int i = 0; i < spellComboArmor.Length; i++) { spellComboArmor[i] = 0; spellComboActive[i] = 0; spellComboPassive[i] = 0; } canCastSpell = new bool[3]; for (int i = 0; i < canCastSpell.Length; i++) canCastSpell[i] = true; }