Example #1
0
 public void closeShop()
 {
     shop.SetActive(false);
     rockwool.SetActive(true);
     Options.SetActive(true);
     StatusUI.SetActive(true);
 }
Example #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            StatusUI obj = new StatusUI();

            obj.Show();
            //this.Hide();
        }
Example #3
0
 public void AlertUI()
 {
     AlertUIOBJ.SetActive(false);
     rockwool.SetActive(true);
     Options.SetActive(true);
     StatusUI.SetActive(true);
 }
Example #4
0
 public void closeInventory()
 {
     bag.SetActive(false);
     rockwool.SetActive(true);
     Options.SetActive(true);
     StatusUI.SetActive(true);
 }
Example #5
0
 private void Awake()
 {
     statusUI       = this;
     text           = GetComponent <Text>();
     isHighlighting = false;
     text.color     = Color.white;
 }
Example #6
0
    /// <summary>
	/// General page handling
	/// </summary>
	public override void OnPageLoad()
	{
        int interval = 60;
        if (!Int32.TryParse(Request.QueryString["interval"], out interval))
        {
            interval = 60;
        }

        if (Request.QueryString["reset"] == "1")
        {
            Statistics.ResetCounters();
        }

        StatusUI statusUI = new StatusUI();
        statusUI.AddFileinfo(ref lbFileInfo);
        statusUI.AddDatabaseVersion(_basePage.CreateDnaDataReaderCreator(),ref lbDatabaseVersion);

        if (Request.QueryString["skin"] == "purexml")
        {
            XmlDocument xDoc = statusUI.OutputXML(interval, this, _basePage.Diagnostics);
            _basePage.WholePageBaseXmlNode.FirstChild.AppendChild(_basePage.WholePageBaseXmlNode.OwnerDocument.ImportNode(xDoc.FirstChild, true));
        }
        else
        {
            statusUI.OutputHTML(interval, ref lblHostName, _basePage.CurrentServerName, ref tblStats);
        }
	}
Example #7
0
 public void openShop()
 {
     shop.SetActive(true);
     bag.SetActive(false);
     rockwool.SetActive(false);
     Options.SetActive(false);
     StatusUI.SetActive(false);
 }
Example #8
0
    public IEnumerator ReflectedAnimation(int oldHealth, Slider healthBar = null, StatusUI statusUI = null, Vector3 direction = new Vector3())
    {
        isMoving = true;
        int     frame            = 25;
        Vector3 originalPosition = GetComponent <Transform>().position;
        Color   originalColor    = GetComponent <SpriteRenderer>().color;

        GameObject g = Instantiate(damageNumber, c.canvas.GetComponent <Transform>());

        g.GetComponent <DamageNumber>().Initialize(oldHealth - c.currentHealth, DamageNumber.DamageType.Reflect);

        for (int i = 0; i < frame; i++)
        {
            if (i < frame / 2)
            {
                GetComponent <SpriteRenderer>().color = Color.Lerp(originalColor, new Color(0.7f, 0.7f, 0f, 0.8f), (float)i / frame * 2);
                if (!direction.Equals(new Vector3()))
                {
                    GetComponent <Transform>().position = Vector3.Lerp(originalPosition, originalPosition + 0.2f * direction, (float)i / frame * 2);
                }
            }
            else
            {
                GetComponent <SpriteRenderer>().color = Color.Lerp(originalColor, new Color(0.7f, 0.7f, 0f, 0.8f), (float)(frame - i) / frame * 2);
                if (!direction.Equals(new Vector3()))
                {
                    GetComponent <Transform>().position = Vector3.Lerp(originalPosition, originalPosition + 0.2f * direction, (float)(frame - i) / frame * 2);
                }
            }

            float f = Mathf.Lerp(c.currentHealth, oldHealth, Mathf.Pow(1 - ((float)i / frame), 2f));
            if (healthBar != null)
            {
                healthBar.value = f;
            }
            if (statusUI != null)
            {
                statusUI.UpdateAll(c, (int)f);
            }

            yield return(null);
        }
        if (healthBar != null)
        {
            healthBar.value = c.currentHealth;
        }
        if (statusUI != null)
        {
            statusUI.UpdateAll(c, c.currentHealth);
        }
        GetComponent <SpriteRenderer>().color = originalColor;
        if (!direction.Equals(new Vector3()))
        {
            GetComponent <Transform>().position = originalPosition;
        }

        isMoving = false;
    }
Example #9
0
 private void Awake()
 {
     controller      = GetComponentInParent <RestController>();
     statusUI        = GetComponentInChildren <StatusUI>();
     dialogueManager = GetComponentInChildren <DialogueManager>();
     inventoryUI     = GetComponentInChildren <InventoryUI>();
     shopUI          = GetComponentInChildren <ShopUI>();
     menuUI          = GetComponentInChildren <MenuUI>();
 }
Example #10
0
 private void cboConnect_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (cboConnect.SelectedItem != null)
     {
         // Convert the selected item on a specific object
         StatusUI newStatus = cboConnect.SelectedItem as StatusUI;
         // Run action related to the status
         runActionStatus(newStatus.Status);
     }
 }
    private void Start()
    {
        controller = GetComponentInParent <RestController>();
        statusUI   = GetComponentInChildren <StatusUI>();
        wheelUI    = GetComponentInChildren <UnitWheelUI>();
        equipUI    = GetComponentInChildren <EquipUI>();
        upgradeUI  = GetComponentInChildren <UpgradeUI>();

        Hide();
    }
Example #12
0
        public static void StatusUI_OpenCoroutine_SetCharaButtonsVisibility(StatusUI __instance)
        {
            var trav         = Traverse.Create(__instance);
            var charaButtons = trav.Field("_charaButtons").GetValue <Button[]>();

            var actorTable = Singleton <Manager.Map> .Instance.ActorTable;

            for (int i = 1; i < charaButtons.Length; i++)
            {
                charaButtons[i].gameObject.SetActiveIfDifferent(actorTable.ContainsKey(i - 1));
            }
        }
Example #13
0
    private void Awake()
    {
        _instanceStatus = this;

        attackTx      = transform.Find("Attack").gameObject.GetComponent <Text>();
        defTx         = transform.Find("Def").gameObject.GetComponent <Text>();
        speedTx       = transform.Find("Speed").gameObject.GetComponent <Text>();
        pointRemainTx = transform.Find("PointRemain").gameObject.GetComponent <Text>();
        summaryTx     = transform.Find("Summary").gameObject.GetComponent <Text>();
        attackPlusBt  = transform.Find("AttackPlusButton").gameObject.GetComponent <Button>();
        defPlusBt     = transform.Find("DefPlusButton").gameObject.GetComponent <Button>();
        speedPlusBt   = transform.Find("SpeedPlusButton").gameObject.GetComponent <Button>();
    }
Example #14
0
        public static void Update()
        {
            if (!Enabled.Value || !Map.IsInstance() || Map.Instance.Player == null)
            {
                return;
            }

            PlayerActor player = Map.Instance.Player;

            if (player.Controller.State is AIProject.Player.Communication && player.CommCompanion != null)
            {
                if (SelectedID != -1)
                {
                    SelectedID = -1;
                    Current    = player.CommCompanion;
                }

                return;
            }

            StatusUI ui = MapUIContainer.SystemMenuUI.StatusUI;

            if (ui != null && ui.EnabledInput)
            {
                if (_selectedID == null)
                {
                    _selectedID = Traverse.Create(ui).Field("_selectedID").GetValue <IntReactiveProperty>();
                }

                if (_selectedID != null)
                {
                    if (_selectedID.Value != SelectedID)
                    {
                        SelectedID = _selectedID.Value;
                        Current    =
                            SelectedID == 0 ?
                            (Actor)Map.Instance.Player :
                            Map.Instance.AgentTable[SelectedID - 1];
                    }

                    return;
                }
            }
            else if (_selectedID != null)
            {
                _selectedID = null;
            }

            SelectedID = -2;
            Current    = null;
        }
Example #15
0
            private static void StatusUI_RefreshAgentContent(StatusUI __instance)
            {
                var objImageRoot = Traverse.Create(__instance).Field("_cardRawImage").GetValue <RawImage>();

                if (objImageRoot == null)
                {
                    return;
                }

                var existingIcon = objImageRoot.transform.Find(ICON_NAME);

                if (existingIcon)
                {
                    Destroy(existingIcon.gameObject);
                }
            }
Example #16
0
    public IEnumerator PoisonedAnimation(int oldHealth, Slider healthBar = null, StatusUI statusUI = null)
    {
        isMoving = true;
        int   frame    = 10;
        Color original = GetComponent <SpriteRenderer>().color;

        GameObject g = Instantiate(damageNumber, c.canvas.GetComponent <Transform>());

        g.GetComponent <DamageNumber>().Initialize(oldHealth - c.currentHealth, DamageNumber.DamageType.Poison);

        for (int i = 0; i < frame; i++)
        {
            if (i < frame / 2)
            {
                GetComponent <SpriteRenderer>().color = Color.Lerp(original, new Color(0.7f, 0f, 0.7f, 0.6f), (float)i / frame * 2);
            }
            else
            {
                GetComponent <SpriteRenderer>().color = Color.Lerp(new Color(1f, 1f, 1f, 1f), new Color(0.7f, 0f, 0.7f, 0.6f), (float)(frame - i) / frame * 2);
            }

            float f = Mathf.Lerp(c.currentHealth, oldHealth, Mathf.Pow(1 - ((float)i / frame), 2f));
            if (healthBar != null)
            {
                healthBar.value = f;
            }
            if (statusUI != null)
            {
                statusUI.UpdateAll(c, (int)f);
            }

            yield return(null);
        }
        if (healthBar != null)
        {
            healthBar.value = c.currentHealth;
        }
        if (statusUI != null)
        {
            statusUI.UpdateAll(c, c.currentHealth);
        }
        GetComponent <SpriteRenderer>().color = new Color(1f, 1f, 1f, 1f);
        isMoving = false;
    }
Example #17
0
            private static void StatusUI_RefreshAgentContent(StatusUI __instance, int id)
            {
                // PregnancyPlugin.Logger.LogDebug("Preg - StatusUI_RefreshAgentContent");
                var objImageRoot = Traverse.Create(__instance).Field("_cardRawImage").GetValue <RawImage>();

                if (objImageRoot == null)
                {
                    return;
                }

                //Ignore player status tab, only want actors
                if (id == 0)
                {
                    var existingIcon = objImageRoot.transform.Find(ICON_NAME);
                    if (existingIcon)
                    {
                        Destroy(existingIcon.gameObject);
                    }
                    return;
                }

                Singleton <Manager.Map> .Instance.AgentTable.TryGetValue((id - 1), out AgentActor _heroine);

                if (_heroine == null)
                {
                    return;
                }

                SpawnGUI();

                IEnumerator HeroineCanvasPreviewUpdateCo()
                {
                    yield return(new WaitForEndOfFrame());

                    _currentHeroine.Clear();
                    //                                                             :right :up
                    SetQuickStatusIcon(objImageRoot.gameObject, _heroine.AgentData, 95f, -80f);
                }

                _pluginInstance.StartCoroutine(HeroineCanvasPreviewUpdateCo());
            }
Example #18
0
    public IEnumerator RegeneratedAnimation(int oldHealth, Slider healthBar = null, StatusUI statusUI = null)
    {
        isMoving = true;
        int frame = 6;

        if (c.currentHealth == oldHealth)
        {
            isMoving = false;

            // 여기서도 코루틴이 종료될 수 있음에 주의!
            yield break;
        }

        GameObject g = Instantiate(damageNumber, c.canvas.GetComponent <Transform>());

        g.GetComponent <DamageNumber>().Initialize(c.currentHealth - oldHealth, DamageNumber.DamageType.Heal);

        for (int i = 0; i < frame; i++)
        {
            float f = Mathf.Lerp(c.currentHealth, oldHealth, Mathf.Pow(1 - ((float)i / frame), 2f));
            if (healthBar != null)
            {
                healthBar.value = f;
            }
            if (statusUI != null)
            {
                statusUI.UpdateAll(GetComponent <Character>(), (int)f);
            }

            yield return(null);
        }
        if (healthBar != null)
        {
            healthBar.value = c.currentHealth;
        }
        if (statusUI != null)
        {
            statusUI.UpdateAll(GetComponent <Character>(), c.currentHealth);
        }
        isMoving = false;
    }
Example #19
0
    public IEnumerator HealedAnimation(int oldHealth, Slider healthBar = null, StatusUI statusUI = null, bool isDrain = false)
    {
        isMoving = true;
        int frame = 25;

        if (isDrain)
        {
            frame = 6;
        }
        Color original   = GetComponent <SpriteRenderer>().color;
        Color afterColor = new Color(1f, 1f, 1f, 1f);

        if (isDrain)
        {
            afterColor = original;
        }

        if (c.currentHealth == oldHealth)
        {
            GetComponent <SpriteRenderer>().color = afterColor;
            isMoving = false;

            // 여기서도 코루틴이 종료될 수 있음에 주의!
            yield break;
        }

        GameObject g = Instantiate(damageNumber, c.canvas.GetComponent <Transform>());

        g.GetComponent <DamageNumber>().Initialize(c.currentHealth - oldHealth, DamageNumber.DamageType.Heal);

        for (int i = 0; i < frame; i++)
        {
            if (!isDrain)
            {
                if (i < frame / 2)
                {
                    GetComponent <SpriteRenderer>().color = Color.Lerp(original, new Color(0f, 0.7f, 0.2f, 0.6f), (float)i / frame * 2);
                }
                else
                {
                    GetComponent <SpriteRenderer>().color = Color.Lerp(afterColor, new Color(0f, 0.7f, 0.2f, 0.6f), (float)(frame - i) / frame * 2);
                }
            }

            float f = Mathf.Lerp(c.currentHealth, oldHealth, Mathf.Pow(1 - ((float)i / frame), 2f));
            if (healthBar != null)
            {
                healthBar.value = f;
            }
            if (statusUI != null)
            {
                statusUI.UpdateAll(GetComponent <Character>(), (int)f);
            }

            yield return(null);
        }
        if (healthBar != null)
        {
            healthBar.value = c.currentHealth;
        }
        if (statusUI != null)
        {
            statusUI.UpdateAll(GetComponent <Character>(), c.currentHealth);
        }
        GetComponent <SpriteRenderer>().color = afterColor;
        isMoving = false;
    }
 private void SetInfo(StatusUI player)
 {
     _avatar.texture = player.Avatar;
     _name.text      = player.Player.GetComponent <TuringOperate>().AIScript.GetTeamName();
 }
        private void Start()
        {
            ObservableExtensions.Subscribe <bool>((IObservable <M0>) this.OnActiveChangedAsObservable(), (Action <M0>)(x => this.SetActiveControl(x)));
            Debug.Log((object)"ーーーーーーーーーーホームメニューUI生成(Start)ーーーーーーーーーー");
            DefinePack definePack   = Singleton <Resources> .Instance.DefinePack;
            string     manifestName = "abdata";
            GameObject gameObject1  = CommonLib.LoadAsset <GameObject>(definePack.ABPaths.MapScenePrefab, "HomeMenu", false, manifestName);

            if (Object.op_Inequality((Object)gameObject1, (Object)null))
            {
                this._homeMenu          = (HomeMenu)((GameObject)Object.Instantiate <GameObject>((M0)gameObject1, (Transform)this._uiRoot, false)).GetComponent <HomeMenu>();
                this._homeMenu.Observer = this;
                this._homeMenu.OnClose  = (Action)(() =>
                {
                    this._homeMenu.IsActiveControl = false;
                    this.IsActiveControl = false;
                });
            }
            Debug.Log((object)"ーーーーーーーーーーホームメニューUI生成(End)ーーーーーーーーーー");
            Debug.Log((object)"ーーーーーーーーーーポーチUI生成(Start)ーーーーーーーーーー");
            GameObject gameObject2 = CommonLib.LoadAsset <GameObject>(definePack.ABPaths.MapScenePrefab, "InventoryUI", false, manifestName);

            if (Object.op_Inequality((Object)gameObject2, (Object)null))
            {
                this._inventoryUI          = (InventoryUIController)((GameObject)Object.Instantiate <GameObject>((M0)gameObject2, (Transform)this._uiRoot, false)).GetComponent <InventoryUIController>();
                this._inventoryUI.capacity = (Func <int>)(() => Singleton <Manager.Map> .Instance.Player.PlayerData.InventorySlotMax);
                this._inventoryUI.itemList = (Func <List <StuffItem> >)(() => Singleton <Manager.Map> .Instance.Player.PlayerData.ItemList);
                this._inventoryUI.Observer = this;
            }
            Debug.Log((object)"ーーーーーーーーーーポーチUI生成(End)ーーーーーーーーーー");
            Debug.Log((object)"ーーーーーーーーーーポーチ(Enter)UI生成(Start)ーーーーーーーーーー");
            GameObject gameObject3 = CommonLib.LoadAsset <GameObject>(definePack.ABPaths.MapScenePrefab, "InventoryEnterUI", false, manifestName);

            if (Object.op_Inequality((Object)gameObject3, (Object)null))
            {
                this._inventoryEnterUI          = (InventoryUIController)((GameObject)Object.Instantiate <GameObject>((M0)gameObject3, (Transform)this._uiRoot, false)).GetComponent <InventoryUIController>();
                this._inventoryEnterUI.capacity = (Func <int>)(() => Singleton <Manager.Map> .Instance.Player.PlayerData.InventorySlotMax);
                this._inventoryEnterUI.itemList = (Func <List <StuffItem> >)(() => Singleton <Manager.Map> .Instance.Player.PlayerData.ItemList);
                this._inventoryEnterUI.Observer = this;
            }
            Debug.Log((object)"ーーーーーーーーーーポーチ(Enter)UI生成(End)ーーーーーーーーーー");
            Debug.Log((object)"ーーーーーーーーーーステータスUI生成(Start)ーーーーーーーーーー");
            GameObject gameObject4 = CommonLib.LoadAsset <GameObject>(definePack.ABPaths.MapScenePrefabAdd05, "StatusUI", false, definePack.ABManifests.Add05);

            if (Object.op_Inequality((Object)gameObject4, (Object)null))
            {
                this._statusUI          = (StatusUI)((GameObject)Object.Instantiate <GameObject>((M0)gameObject4, (Transform)this._uiRoot, false)).GetComponent <StatusUI>();
                this._statusUI.Observer = this;
                this._statusUI.OnClose  = (Action)(() =>
                {
                    Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.Cancel);
                    this._statusUI.OpenID = 0;
                    this._statusUI.IsActiveControl = false;
                    this.OpenModeMenu(SystemMenuUI.MenuMode.Home);
                });
            }
            Debug.Log((object)"ーーーーーーーーーーステータスUI生成(End)ーーーーーーーーーー");
            // ISSUE: method pointer
            ((UnityEvent)this._notifyingUI.PouchOpen.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003CStart\u003Em__A)));
            // ISSUE: method pointer
            ((UnityEvent)this._notifyingUI.NotGet.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003CStart\u003Em__B)));
            if (!Object.op_Implicit((Object)this._closeButton))
            {
                return;
            }
            // ISSUE: method pointer
            ((UnityEvent)this._closeButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(\u003CStart\u003Em__C)));
            this._closeButtonCanvasGroup = (CanvasGroup)((Component)this._closeButton).GetComponent <CanvasGroup>();
        }
        public static void OnGUI()
        {
            if (!MapUIContainer.IsInstance())
            {
                return;
            }

            StatusUI ui = MapUIContainer.SystemMenuUI.StatusUI;

            if (!ui || !ui.EnabledInput)
            {
                if (selected != null)
                {
                    selected = null;
                }

                return;
            }

            if (selected == null)
            {
                selected = Traverse.Create(ui).Field("_selectedID").GetValue <IntReactiveProperty>();
            }

            if (selected == null || selected.Value == 0)
            {
                return;
            }

            agent = Map.Instance.AgentTable[selected.Value - 1];

            if (agent.ChaControl.fileGameInfo.phase < 2)
            {
                return;
            }

            if (headerStyle == null)
            {
                headerStyle = new GUIStyle(GUI.skin.label)
                {
                    fontStyle = FontStyle.Bold
                };

                addStyle = new GUIStyle(GUI.skin.button)
                {
                    fontStyle = FontStyle.Bold,
                    normal    =
                    {
                        textColor = Color.green
                    },
                    focused =
                    {
                        textColor = Color.green
                    },
                    active =
                    {
                        textColor = Color.green
                    },
                    hover =
                    {
                        textColor = Color.green
                    },
                };

                removeStyle = new GUIStyle(GUI.skin.button)
                {
                    fontStyle = FontStyle.Bold,
                    normal    =
                    {
                        textColor = Color.red
                    },
                    focused =
                    {
                        textColor = Color.red
                    },
                    active =
                    {
                        textColor = Color.red
                    },
                    hover =
                    {
                        textColor = Color.red
                    },
                };
            }

            rect = Window.Draw(WindowID.Value, rect, Draw, "Mad Skills");
        }
Example #23
0
        public static void StatusUI_OnBeforeStart_AddElementsAndBackgrounds(StatusUI __instance)
        {
            var trav            = Traverse.Create(__instance);
            var oldcharaButtons = trav.Field("_charaButtons").GetValue <Button[]>();

            List <Button> newCharaButtons = new List <Button>();

            newCharaButtons.AddRange(oldcharaButtons);

            int oldCharaButtonsLength = oldcharaButtons.Length;

            for (int i = 0; i < 1 + girlCount - oldCharaButtonsLength; i++)
            {
                var copy = Instantiate(oldcharaButtons[oldCharaButtonsLength - 1], oldcharaButtons[oldCharaButtonsLength - 1].transform.parent);
                copy.name = $"Chara ({oldCharaButtonsLength + i - 1:0})";

                newCharaButtons.Add(copy.GetComponent <Button>());
            }

            List <Dictionary <int, CanvasGroup> > backgrounds = new List <Dictionary <int, CanvasGroup> >
            {
                trav.Field("_equipmentBackgrounds").GetValue <Dictionary <int, CanvasGroup> >(),
                trav.Field("_equipmentFlavorBackgrounds").GetValue <Dictionary <int, CanvasGroup> >(),
                trav.Field("_skillBackgrounds").GetValue <Dictionary <int, CanvasGroup> >(),
                trav.Field("_skillFlavorBackgrounds").GetValue <Dictionary <int, CanvasGroup> >()
            };

            foreach (var category in backgrounds.Where(category => category.Count < girlCount + 1))
            {
                for (int i = 0; i < 1 + girlCount; i++)
                {
                    if (i < defaultGirlCount + 1 || category.Count >= girlCount + 1)
                    {
                        continue;
                    }

                    CanvasGroup bgData = Instantiate(category[category.Count - 1], category[category.Count - 1].transform.parent);
                    bgData.name = $"Chara ({i:0})";

                    category.Add(category.Count, bgData);
                }
            }

            trav.Field("_equipmentBackgrounds").SetValue(backgrounds[0]);
            trav.Field("_equipmentFlavorBackgrounds").SetValue(backgrounds[1]);
            trav.Field("_skillBackgrounds").SetValue(backgrounds[2]);
            trav.Field("_skillFlavorBackgrounds").SetValue(backgrounds[3]);
            trav.Field("_charaButtons").SetValue(newCharaButtons.ToArray());

            trav = Traverse.Create(__instance.Observer);
            Dictionary <int, CanvasGroup> mainBackgrounds = trav.Field("_backgrounds").GetValue <Dictionary <int, CanvasGroup> >();

            for (int i = 0; i < 2 + girlCount; i++)
            {
                if (i < defaultGirlCount + 2 || mainBackgrounds.Count >= girlCount + 2)
                {
                    continue;
                }

                CanvasGroup bgData = Instantiate(
                    mainBackgrounds[defaultGirlCount],
                    mainBackgrounds[defaultGirlCount].transform.parent
                    );
                bgData.name = $"Chara ({i - 2:0})";

                mainBackgrounds.Add(mainBackgrounds.Count - 1, bgData);
            }

            trav.Field("_backgrounds").SetValue(mainBackgrounds);

            StatusUI_AddScroll();
        }
Example #24
0
    public override IEnumerator DamagedAnimation(int oldHealth, Slider healthBar = null, StatusUI statusUI = null, Vector3 direction = new Vector3(), bool isCritical = false)
    {
        isMoving = true;
        float         frame = 16, frame2 = 0, frame3 = 10;
        Vector3       originalPosition = t.position;
        Color         originalColor    = GetComponent <SpriteRenderer>().color;
        DamagedScreen damagedScreen    = GameManager.gm.Canvas.GetComponent <UIInfo>().DamagedPanel;

        DamageNumber.DamageType dt = DamageNumber.DamageType.Normal;
        if (isCritical)
        {
            dt = DamageNumber.DamageType.Critical;
        }

        if (!direction.Equals(new Vector3()))
        {
            GameObject g = Instantiate(damageNumber, c.canvas.GetComponent <Transform>());
            g.GetComponent <DamageNumber>().Initialize(oldHealth - c.currentHealth, dt);
        }

        for (int i = 0; i < frame + frame2; i++)
        {
            if (i < frame / 2)
            {
                GetComponent <SpriteRenderer>().color = Color.Lerp(originalColor, new Color(0.7f, 0f, 0f, 0.6f), i / frame * 2);
                if (!direction.Equals(new Vector3()))
                {
                    t.position = Vector3.Lerp(originalPosition, originalPosition + 0.2f * direction, i / frame * 2);
                }
            }
            else
            {
                GetComponent <SpriteRenderer>().color = Color.Lerp(originalColor, new Color(0.7f, 0f, 0f, 0.6f), (frame + frame2 - i) / (frame / 2 + frame2));
                if (!direction.Equals(new Vector3()))
                {
                    t.position = Vector3.Lerp(originalPosition, originalPosition + 0.2f * direction, (frame + frame2 - i) / (frame / 2 + frame2));
                }
            }

            if (c.currentHealth <= c.MaxHealth / 6)
            {
                damagedScreen.StartEffect(true);
            }
            else if (c.currentHealth <= c.MaxHealth / 3)
            {
                damagedScreen.StartEffect(false);
            }

            if (i < frame)
            {
                float f = Mathf.Lerp(c.currentHealth, oldHealth, Mathf.Pow(1 - (i / frame), 2f));
                if (healthBar != null)
                {
                    healthBar.value = f;
                }
                if (statusUI != null)
                {
                    statusUI.UpdateAll(c, (int)f);
                }
            }

            yield return(null);
        }
        if (healthBar != null)
        {
            healthBar.value = c.currentHealth;
        }
        if (statusUI != null)
        {
            statusUI.UpdateAll(c, c.currentHealth);
        }
        GetComponent <SpriteRenderer>().color = originalColor;
        if (!direction.Equals(new Vector3()))
        {
            t.position = originalPosition;
        }

        for (int i = 0; i < frame3; i++)
        {
            yield return(null);
        }

        isMoving = false;
    }
Example #25
0
 public virtual IEnumerator DamagedAnimation(int oldHealth, Slider healthBar = null, StatusUI statusUI = null, Vector3 direction = new Vector3(), bool isCritical = false)
 {
     yield return(null);
 }
Example #26
0
 public void RemoveStatusUI(StatusUI statusUIToRemove)
 {
     statusUIs.Remove(statusUIToRemove.gameObject);
     Destroy(statusUIToRemove.gameObject);
 }
Example #27
0
 public void WhenIOpenTheStatusUI()
 {
     _ui = _engine.OpenUI();
 }