private void InitializeGuardedTile() // run when an owner is assigned to this guarded tile. { if (PlayerDetector != null) { Destroy(PlayerDetector.gameObject); } if (AudioManager.Instance != null) { AudioManager.Instance.PlaySFX(GuardTileClaimed); } AreaOfAttack.enabled = true; PlayerDetector.enabled = false; ButtonRender.material = OwnedMaterial; PlayerPersonalization ownerPersonalization = state.EntityOwner.GetComponent <PlayerPersonalization>(); colorIntensity = Player_Colors.GetColorIntensity(ownerPersonalization.GetColor()); OwnerText.text = ownerPersonalization.GetName() + "'s tile"; Color GuardedMaterialColor = state.EntityOwner.GetComponent <PlayerPersonalization>().PlayerGraphics.material.color; ButtonRender.material.color = GuardedMaterialColor; ButtonRender.material.SetColor("_EmissionColor", GuardedMaterialColor * colorIntensity * 0.6f); // change this multiplier. print("I am now claimed!"); ButtonAnim.Play(AnimHashID); }
private void Start() { Menu = noButton.GetComponent <OpenMenu>(); buttunActive = GetComponent <ButtonAnim>(); if (Singleton.Instance.ButtonFlag[1] == 1 && Singleton.Instance.ButtonFlag[2] == 0) { buttunActive.enabled = true; } }
void Update() { if (hit1 >= 0) { _hp1 = score; // HPゲージに値を設定 slider1.value = _hp1; } if (hit2 >= 0) { _hp2 = score; // HPゲージに値を設定 slider2.value = _hp2; } if (hit3 >= 0) { _hp3 = score; // HPゲージに値を設定 slider3.value = _hp3; } _hp4 = score; // HPゲージに値を設定 slider4.value = _hp4; // スコアが〜〜より大きければ if (hit2 < score) { //button2.gameObject.SetActive (true); buttonAnim = gameobject2.GetComponent <ButtonAnim>(); buttonAnim.ButtonAnimSet(); } if (hit1 < score) { //button2.gameObject.SetActive (true); buttonAnim1 = gameobject1.GetComponent <ButtonAnim1>(); buttonAnim1.ButtonAnim1Set(); } if (hit3 < score) { // button3.gameObject.SetActive (true); buttonAnim3 = gameobject3.GetComponent <ButtonAnim3>(); buttonAnim3.ButtonAnim3Set(); } }