// Start is called before the first frame update void Start() { hitDetect = GetComponentInChildren <HitDetection>(); attackAnimator = GetComponentInChildren <Animator>(); shootingProjectile = GetComponent <ShootingProjectiles>(); stats = GetComponent <PlayerStats>(); body = GetComponent <Rigidbody2D>(); currentHealth = stats.getHealth(); resources = GetComponent <ResourceBag>(); resources.initEmpty(); abovePlayerUI = (Instantiate(Resources.Load("UI/Healthbar")) as GameObject); healthbar = abovePlayerUI.GetComponentInChildren <Slider>(); nameUI = abovePlayerUI.GetComponentInChildren <TMPro.TextMeshProUGUI>(); spawn = new Vector2(transform.position.x, transform.position.y); timeOfLastClick = Time.time; if (isLocalPlayer) { hitDetect.isTheLocalPlayer = true; uiControl = GameObject.FindObjectOfType <UI_Control>(); uiControl.player = this; UI_Camera uiCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <UI_Camera>(); mnmenu = GameObject.FindObjectOfType <MonumentalNetworkMenu>(); uiCamera.followTarget = this.gameObject; currentHealth = stats.getHealth(); spriteRender = this.GetComponent <SpriteRenderer>(); spriteRender.sprite = classSprites[stats.Class]; } }
private void Start() { cam = GameObject.FindObjectOfType <UI_Camera>(); audioSrc = GetComponent <AudioSource>(); if (!audioSrc) { audioSrc = this.gameObject.AddComponent <AudioSource>(); } }
private void Start() { movement = GetComponent <PlayerMovement>(); stats = GetComponent <PlayerStats>(); rigidBody = GetComponent <Rigidbody2D>(); fishing = GetComponent <PlayerFishing>(); classUlt = GetComponent <ClassUltimate>(); helpMenu = GetComponentInChildren <PlayerMenu>(); helpMenu.frame.SetActive(false); playerInventory.gameObject.SetActive(true); /* Assume one camera exists */ cam = GameObject.FindObjectOfType <UI_Camera>(); }
IEnumerator MissionShow() { Main_Camera.SetActive(false); UI_Camera.AddComponent <AudioListener>(); UIAudioSrc.Play(); yield return(new WaitForSeconds(UIAudioSrc.clip.length)); Debug.LogWarning("10012_C02_wav.aax播放完毕,进入关卡"); BackGroundPic.SetActive(false); ULabel.SetActive(false); Main_Camera.SetActive(true); Spotlight.SetActive(false); Scene_BGM.Play(); JoyStickPanel_Left.SetActive(true); DragButton.SetActive(true); playerManager.loadJoyStick(); }
void Awake() { Instance = this; }
protected override void OnEquip(WeaponInventory inv) { this.linkSpeed = this.tables.whipLinkSpeed.get(this.weaponClass).Value; WhipLink = tables.whipLinkObj.WhipOBJ; this.cam = GameObject.FindObjectOfType <UI_Camera>(); }
private void Awake() { Instance = this; }
void Start() { Instance = this; }