public void CreateRole(int ID) { myRole = PhotonNetwork.Instantiate("Darkman Solider", Random.onUnitSphere * 5f, Quaternion.identity, 0); if (ID == 0) { playersInfo.myID = PhotonNetwork.room.playerCount; GameObject myPlayer = GameObject.Find("Player" + PhotonNetwork.room.playerCount.ToString()); myRole.transform.parent = myPlayer.transform; myPhotonView = myPlayer.GetComponent <PhotonView>(); myPhotonView.observed = myRole.GetComponent <NetworkController>(); } playersInfo.alive[ID] = true; //AddTag(myPhotonView); if (myPhotonView.isMine) { TP_Animator playerAnimator = myRole.GetComponent <TP_Animator>(); TP_Motor playerMotor = myRole.GetComponent <TP_Motor>(); TP_Controller playerController = myRole.GetComponent <TP_Controller>(); TP_Info playerInfo = myRole.GetComponent <TP_Info>(); playerAnimator.enabled = true; playerMotor.enabled = true; playerController.enabled = true; playerInfo.enabled = true; } }
void OnAllScripts() { playerMotor = GetComponent <TP_Motor>(); playerAnimator = GetComponent <TP_Animator>(); playerInfo = GetComponent <TP_Info>(); gameObject.name = gameObject.name + photonView.viewID; /*playerCamera = transform.FindChild("Camera").gameObject;// transform.FindChild("Camera").gameObject; * playerAttack = transform.FindChild("AttackRangeCol").gameObject; * if(photonView.isMine) * { * playerCamera.SetActive(true); * playerAttack.SetActive(true); * playerCamera.transform.parent = transform.FindChild("targetLookAt").transform; * playerController.OnPlayerAttack(); * playerAnimator.OnPlayerAttack(); * } * else * { * playerCamera.gameObject.SetActive(false); * playerController.OnPlayerAttack(); * playerAnimator.OnPlayerAttack(); * playerAttack.gameObject.SetActive(true); * } * playerController.SetIsLocalPlayer(photonView.isMine);*/ }
} // The vertical velocity of the character. #endregion #region UNITY_FUNCTIONS // Use this for initialization void Awake() { if (instance != this) { instance = this; } }
/** * Setup function */ void Awake() { myTrailSnow = SnowTrailParticle; myTrailTrack = myTrailSnow.GetComponent("TrailRenderer") as TrailRenderer; inputFriction = Vector3.zero; Instance = this; }
void Awake() { if (Instance == null) { Instance = this; } gravityOn = true; }
void Awake() { Instance = this; playerHealth = 100; if (HealthVisualBar != null) HealthVisualBar.value = playerHealth; }
private void Awake() { if (Instance == null) { Instance = this; } data.controller = GetComponent <CharacterController>(); source = GetComponent <AudioSource>(); }
private void Start() { //Initalization. motor = TP_Motor.Instance; target = motor.transform; //Begin spawning the enemy. StartCoroutine(InitializeEnemy()); }
void Awake() { if (instance != null) { Debug.Log("Instance of TP_Motor already exists"); return; } instance = this; }
void Awake() { parentTrans = transform.parent; CC = parentTrans.GetComponent <CharacterController>(); playerInfo = parentTrans.GetComponent <TP_Info>(); playerMotor = parentTrans.GetComponent <TP_Motor>(); roomMenu = GameObject.FindGameObjectWithTag("RoomMenu").GetComponent <InRoom_Menu>(); myPhotonView = transform.parent.GetComponent <PhotonView>(); _lockAttackCheck = false; attackDistance = 100; }
public override void ApplySettings() { if (DIRE.Instance.DisplayOrigin.activeSelf) { DIRE.Instance.DisplayOrigin.GetComponent <ARTtrack>().SetTracking(trackingEnabled); } TP_Motor tpMotorScript = GameObject.FindObjectOfType <TP_Motor>(); tpMotorScript.ForwardSpeed = avatarForwardSpeed; tpMotorScript.BackwardSpeed = avatarBackwardSpeed; tpMotorScript.StrafingSpeed = avatarStrafeSpeed; }
void Awake() { Instance = this; CC = gameObject.GetComponent <CharacterController>(); playerInfo = GetComponent <TP_Info>(); playerController = GetComponent <TP_Controller>(); playerAnimator = GetComponent <TP_Animator>(); myTransform = transform; myPos = myTransform.position; isAlignCamera = true; //JumpSpeed = 400f; Gravity = 500f; TerminalVelocity = 1000f; }
void Awake() { IsRunning = true; CharacterController = GetComponent("CharacterController") as CharacterController; playerAnimator = GetComponent <TP_Animator>(); playerMotor = GetComponent <TP_Motor>(); playerInfo = GetComponent <TP_Info>(); roomMenu = GameObject.FindGameObjectWithTag("RoomMenu").GetComponent <InRoom_Menu>(); myPhotonView = GetComponent <PhotonView>(); Instance = this; UselightSourceTimer = 0; buffSkillType = new TP_Animator.BuffSkillType[2]; }
void Awake() { Instance = this; characterMesh = GameObject.Find("MainChar") as GameObject; }
void Awake() { Instance = this; }
void Awake() { _instance = this; }
void Start() { Instance = this; }
/*void Awake() { CharacterController = GetComponent<CharacterController>() as CharacterController; Instance = this; //P_Camera.UseExistingOrCreateNewMainCamera () //Debug.Log(isLocalPlayer); //if (isLocalPlayer) //{ TP_Camera.CreateNewMainCamera(netId.ToString()); //} }*/ void Awake() { motor = GetComponent<TP_Motor>(); }
void Start() { instance = this; }
// Use this for initialization void Awake() { Instance = this; IsSliding = false; }
void Awake() { Instance = this; moveVector = targetDir = Vector3.zero; }
void Awake() { if(Instance == null) Instance = this; gravityOn = true; }
/*void Awake() * { * CharacterController = GetComponent<CharacterController>() as CharacterController; * Instance = this; * * //P_Camera.UseExistingOrCreateNewMainCamera () * //Debug.Log(isLocalPlayer); * //if (isLocalPlayer) * //{ * TP_Camera.CreateNewMainCamera(netId.ToString()); * //} * }*/ void Awake() { motor = GetComponent <TP_Motor>(); }