コード例 #1
0
            } // end Update

            public void Recycling() {
                damage = null;
                foreach (TrailRenderer trail in GetComponentsInChildren<TrailRenderer>()) {
                    trail.Clear();
                } // end foreach
                InstanceMgr.GetObjectManager().Recycling(poolName, gameObject);
            } // end Recycling
コード例 #2
0
                } // end CheckAttributeData

                public override void UnderAttack(IDamageData damage) {
                    if (null == damage) return;
                    // end if
                    IRealData realData = new RealData(damage, m_charcterData);
                    m_charcterData.Minus(realData);
                    Vector2 screenPoint = SceneManager.mainCamera.camera.WorldToScreenPoint(character.helpTransform.position);
                    Vector2 hud_pos;
                    if (RectTransformUtility.ScreenPointToLocalPointInRectangle(SceneManager.mainCanvas.HUD_rectTRansform, screenPoint,
                        SceneManager.mainCanvas.camera, out hud_pos)) {
                        HUD_Damage hud = InstanceMgr.GetObjectManager().GetGameObject<HUD_Damage>(HUD_Damage.poolName);
                        hud.SetNumber(realData.HP);
                        hud.transform.SetParent(SceneManager.mainCanvas.HUD_rectTRansform, false);
                        hud.transform.localPosition = hud_pos;
                        hud.gameObject.SetActive(true);
                    } // end if
                    if (null != lockCharacter) return;
                    // end if
                    if (damage.hashID == SceneManager.mainCharacter.hashID) {
                        LockCharacter(SceneManager.mainCharacter);
                        return;
                    } // end if
                    ICharacter npc = SceneManager.characterManager.factory.GetNPCharacter(damage.hashID);
                    if (null != npc) {
                        LockCharacter(npc);
                    } // end if
                } // end UnderAttack
コード例 #3
0
ファイル: RealData.cs プロジェクト: HelloWindows/Solider
                } // end RealData

                public RealData(IDamageData damage, ICharacterData target)
                {
                    if (null == damage || null == target)
                    {
                        ismiss = true;
                        return;
                    } // end if
                    ismiss = UnityEngine.Random.Range(0, 100f + damage.HIT) < target.AVD;
                    HP     = MathTool.LimitZero(damage.ATK - MathTool.Percent(target.DEF, damage.DEFR + 100f)) +
                             MathTool.LimitZero(damage.MGK - MathTool.Percent(target.RGS, damage.RGSR + 100f));
                } // end RealData
コード例 #4
0
        public virtual void ReceiveDamage(IDamageData damageData)
        {
            if (useLog)
            {
                Debug.Log($"{Name} {nameof(ReceiveDamage)} {damageData}");
            }

            healthController.ReceiveDamage(damageData.Damage);

            if (healthController.CurrentHealth <= 0.0f)
            {
                Kill(new KillerInfo(damageData.DamageOwner, damageData.DamageSource));
            }
        }
コード例 #5
0
            } // end Awake

            public void SetDamage(IDamageData damage)
            {
                this.damage = damage;
            } // end SetDamage
コード例 #6
0
                } // end LockCharacter

                public override void UnderAttack(IDamageData data)
                {
                    IRealData realData = new RealData(data, m_charcterData);

                    m_charcterData.Minus(realData);
                } // end UnderAttack
コード例 #7
0
            } // end OnEnable

            public void SetDamage(string poolName, IDamageData damage) {
                this.poolName = poolName;
                this.damage = damage;
            } // end SetDamage
 public void ReceiveDamage(IDamageData damageData) => damageable.ReceiveDamage(damageData);
コード例 #9
0
 public DamageDataComponent(IDamageData data)
 {
     _data = data;
 }
コード例 #10
0
ファイル: CharacterInfo.cs プロジェクト: HelloWindows/Solider
 public abstract void UnderAttack(IDamageData data);
コード例 #11
0
ファイル: Damager.cs プロジェクト: CipicReborn/proto-shooter
 public Damager(IDamageData data, IBehaviourController controller)
 {
     this.data       = data;
     this.controller = controller;
 }
コード例 #12
0
            } // end Update

            public void Recycling() {
                damage = null;
                InstanceMgr.GetObjectManager().Recycling(poolName, gameObject);
            } // end Recycling