コード例 #1
0
        public BulletController(BulletModel bulletModel, BulletView bulletView)
        {
            BulletModel = bulletModel;
            BulletView  = bulletView;

            BulletView = GameObject.Instantiate <BulletView>(bulletView);
            BulletView.Initialize(this);
            BulletView.transform.position = BulletModel.Position.position;
            BulletView.transform.rotation = BulletModel.Position.rotation;
        }
コード例 #2
0
        public BulletController CreateBullet(Transform position, BulletVariants bulletVariants)
        {
            BulletModel bulletModel = new BulletModel(bulletScriptableObject[0], position);

            switch (bulletVariants)
            {
            case BulletVariants.WEAK:
                bulletModel = new BulletModel(bulletScriptableObject[0], position);
                break;

            case BulletVariants.MEDIUM:
                bulletModel = new BulletModel(bulletScriptableObject[1], position);
                break;

            case BulletVariants.STRONG:
                bulletModel = new BulletModel(bulletScriptableObject[2], position);
                break;
            }
            BulletController bulletController = new BulletController(bulletModel, bulletView);

            return(bulletController);
        }