コード例 #1
0
        public void 结构值字段buff()
        {
            // Use the Assert class to test conditions.
            StructBuffManager structBuffManager = new StructBuffManager();

            structBuffManager.AddBuff(new Enity(), new buff3(_getCurrentMilliSeconds()));
        }
コード例 #2
0
        public void 空结构buff创建()
        {
            // Use the Assert class to test conditions.
            StructBuffManager structBuffManager = new StructBuffManager();

            addBuff(structBuffManager, new buff2(_getCurrentMilliSeconds()));
        }
コード例 #3
0
        public void 结构含私有引用属性buff不允许()
        {
            // Use the Assert class to test conditions.
            StructBuffManager structBuffManager = new StructBuffManager();

            var ex = Assert.Catch <TypeErrorException>(() => { structBuffManager.AddBuff(new Enity(), new buff7(_getCurrentMilliSeconds())); });

            Debug.Log(ex.Message);
        }
コード例 #4
0
        public void 类buff创建不允许()
        {
            // Use the Assert class to test conditions.
            StructBuffManager structBuffManager = new StructBuffManager();

            var exception = Assert.Catch <TypeErrorException>(() => { structBuffManager.AddBuff(new Enity(), new buff1()); });

            if (!exception.Message.Contains("not is Struct Type"))
            {
                Assert.Fail();
            }
            Debug.Log(exception.Message);
        }
コード例 #5
0
 private void addBuff(StructBuffManager structBuffManager, buff2 buff2)
 {
     structBuffManager.AddBuff(new Enity(), buff2);
 }