コード例 #1
0
ファイル: Shooting.cs プロジェクト: TAvsec/VoxLand
    public void shoot(float delayBetweenShots)
    {
        //anim.SetBool("shoot",true);

        if (x >= delayBetweenShots)
        {
            anim.SetBool("shoot", true);

            RaycastHit hit;
            if (Physics.Raycast(cam.transform.position, cam.transform.forward, out hit, range))
            {
                Debug.Log(hit.transform.name);

                DummyTarget dTarget = hit.transform.GetComponent <DummyTarget>();
                if (dTarget != null)
                {
                    dTarget.TakeDamage(damage);
                }
            }
            x = 0;
        }
        else
        {
            x += Time.deltaTime;
        }
    }
コード例 #2
0
ファイル: TargetsParserTest.cs プロジェクト: nbucket/bounce
        public void ShouldCheckForNullIfPropertyAbsent()
        {
            // arrange

            var targets = new DummyTarget {
                A = new Mock<IObsoleteTask>().Object,
                B = null
            };

            // act / assert (no exceptions)
            var targetsDictionary = new TargetsParser().ParseTargetsFromObject(targets);
        }
コード例 #3
0
        public override void Init()
        {
            var dummyTarget1 = new DummyTarget("DUMMY_A", "Dummy A", "DT-A");

            dummyTarget1.MoveTo(1000, 0, 1000);
            World.AddEntity(dummyTarget1);

            var dummyTarget2 = new DummyTarget("DUMMY_B", "Dummy B", "DT-B");

            dummyTarget2.MoveTo(-2000, 0, -2000);
            World.AddEntity(dummyTarget2);
        }
コード例 #4
0
        public void ShouldCheckForNullIfPropertyAbsent()
        {
            // arrange

            var targets = new DummyTarget {
                A = new Mock <IObsoleteTask>().Object,
                B = null
            };

            // act / assert (no exceptions)
            var targetsDictionary = new TargetsParser().ParseTargetsFromObject(targets);
        }
コード例 #5
0
ファイル: MyMission.cs プロジェクト: Ingannatore/opensbs
        public override void Init()
        {
            var dummyTarget1 = new DummyTarget("DUMMY_1", "Dummy 1", "DT-1");

            dummyTarget1.MoveTo(2000, 0, 0);
            World.AddEntity(dummyTarget1);

            var dummyTarget2 = new DummyTarget("DUMMY_2", "Dummy 2", "DT-2");

            dummyTarget2.MoveTo(500, 0, -3000);
            World.AddEntity(dummyTarget2);

            var dummyTarget3 = new DummyTarget("DUMMY_3", "Dummy 3", "DT-3");

            dummyTarget3.MoveTo(-6000, 0, 2000);
            World.AddEntity(dummyTarget3);
        }
コード例 #6
0
 public DummyTargetTest()
 {
     _target = Registry.GetTarget("dummy-target") as DummyTarget;
 }