public void SetHP(float hitPoint) { this.hitPoint = hitPoint; GameObject hp = null; for (int i = 0; i < hitPoint; i++) { hp = Instantiate(hpObj); hpObjects.Add(hp); SizeFitter.FittingContent(hp, gameObject); SizeFitter.FittingSize(hp); } float residualPoint = hitPoint - (float)Math.Truncate(hitPoint); if (residualPoint > 0) { hp = Instantiate(hpObj); hp.GetComponent <Image>().fillAmount = residualPoint; hpObjects.Add(hp); SizeFitter.FittingContent(hp, gameObject); SizeFitter.FittingSize(hp); } }
public void ReciveMessage(string message) { JObject chatMessage = JObject.Parse(message); try { ChatObject chat = Instantiate(chatObject); chat.outputText.text = chatMessage[ChatHelper.Message.ToString()].ToString(); chat.client.text = chatMessage[ChatHelper.Client.ToString()].ToString(); try { chat.profile.sprite = Resources.Load <Sprite>(chatMessage[ChatHelper.Profile.ToString()].ToString()); } catch (Exception e) { } SizeFitter.FittingContent(chat.gameObject, contentPanel); } catch (Exception e) { Debug.Log("Chat에러" + e); } }
public void SideEffect(float time, AttackType type, CrowdControlEffect effect, FollowUpEffect followUpEffect = null) { if (!crowdControls.ContainsKey(type.ofensiveType)) { GameObject crowd = Instantiate(crowdControl); SizeFitter.FittingContent(crowd, gameObject); crowdControls.Add(type.ofensiveType, crowd.GetComponent <CrowdControl>()); crowdControls[type.ofensiveType].controler = this; } crowdControls[type.ofensiveType].SetCrowdControl(time, type.effect, effect, followUpEffect); // subSprites[0].sprite = sprite; // IEnumerator coroutine =CrowdControl(time, effect); }
public virtual void NotifyChangeList() { Destroy(content); Debug.Log("노티파잉"); content = Instantiate(container); SizeFitter.FittingContent(content, parent); SizeFitter.FittingSize(content); if (this.GetComponentInChildren <ScrollRect>() != null) { this.GetComponentInChildren <ScrollRect>().content = content.GetComponent <RectTransform>(); } foreach (IListObjectInfo info in infos) { AddPanel(info); } }
public void MakeEye(int eye) { GameObject eyeObject = Instantiate(this.eye); DiceEye diceEye = eyeObject.GetComponent <DiceEye>(); SizeFitter.FittingContent(eyeObject, gameObject); diceEye.Init(this); foreach (DiceEye eyeObj in eyes) { eyeObj.ChangeSprite(diceStatus.dotSprite); } eyes.Add(diceEye); //여기 이후론 눈 숫자에 따라서 위치 조정 switch (eye) { case 2: eyes[0].transform.localPosition = new Vector3(-0.25f, 0); eyes[1].transform.localPosition = new Vector3(0.25f, 0); break; case 3: eyes[0].transform.localPosition = new Vector3(-0.25f, 0.25f); eyes[1].transform.localPosition = new Vector3(0, 0); eyes[2].transform.localPosition = new Vector3(0.25f, -0.25f); break; case 4: eyes[0].transform.localPosition = new Vector3(-0.25f, 0.25f); eyes[1].transform.localPosition = new Vector3(0.25f, 0.25f); eyes[2].transform.localPosition = new Vector3(-0.25f, -0.25f); eyes[3].transform.localPosition = new Vector3(0.25f, -0.25f); break; } }