Esempio n. 1
0
        public UFA1StraightEnemy(GameObject _go, RiaCharacterScript _script, PlayerNumber _playerNumber) : base(_go, _script, _playerNumber)
        {
            this.Script = _script as UFA1StraightEnemyScript;

            // bullet関係
            this.shooter = new Shooter(this.Script.ShotParam, this.bulletManager, this.Trans);
        }
        public KaitoNormalBullet(GameObject _go, RiaCharacterScript _script, PlayerNumber _playerNumber) : base(_go, _script, _playerNumber)
        {
            // CharacterScriptの上書き
            this.Script = _script as KaitoNormalBulletScript;

            this.spRender        = this.Actor.GetComponent <SpriteRenderer>();
            this.spRender.sprite = this.Script.Sprite;
        }
Esempio n. 3
0
        public AirosSpecialBullet(GameObject _go, RiaCharacterScript _script, PlayerNumber _playerNumber) : base(_go, _script, _playerNumber)
        {
            // CharacterScriptの上書き
            this.Script = _script as AirosSpecialBulletScript;

            // RiaSpriteAnimation[] animations = { this.Script.Animation };
            // this.animator.SetAnimations(animations, this.Script.Animation.KeyName);
        }
Esempio n. 4
0
        public InToOutSinEnemyBullet(GameObject _go, RiaCharacterScript _script, PlayerNumber _playerNumber) : base(_go, _script, _playerNumber)
        {
            // CharacterScriptの上書き
            this.Script = _script as InToOutSinEnemyBulletScript;

            // アニメーションの設定
            RiaSpriteAnimation[] animations = { this.Script.Animation };
            this.animator.SetAnimations(animations, this.Script.Animation.KeyName);
        }
        public KaoruPlayer(GameObject _go, RiaCharacterScript _script, PlayerNumber _playerNumber) : base(_go, _script, _playerNumber)
        {
            // CharacterScriptの上書き
            this.Script = _script as KaoruPlayerScript;

            // パラメータ
            nsParam   = new NormalShotParam();
            ssParam   = new SpecialShotParam();
            skilParam = new SkilParam();
        }
Esempio n. 6
0
        public UFA1InToOut(GameObject _go, RiaCharacterScript _script, PlayerNumber _playerNumber) :
            base(_go, _script, _playerNumber)
        {
            this.Script = _script as UFA1InToOutScript;

            // move
            this.move.state           = MoveParam.State.Go;
            this.move.startPos_       = this.Trans.position;
            this.move.stayElapsedTime = 0;
            this.shooter = new Shooter(this.Script.ShotParam, this.bulletManager, this.Trans);
        }
        public RiaCharacter(GameObject _go, RiaCharacterScript _script, PlayerNumber _playerNumber)
        {
            this.Go     = _go;
            this.Trans  = this.Go.transform;
            this.Actor  = this.Go.GetComponent <RiaActor>();
            this.Script = _script;

            this.PlayerNumber      = _playerNumber;
            this.RivalPlayerNumber = (this.PlayerNumber == PlayerNumber.player1) ? PlayerNumber.player2 : PlayerNumber.player1;

            this.playElapsedTime = 0;
        }
Esempio n. 8
0
        public void WakeUp(RiaCharacter _character, RiaCharacterScript _characterScript,
                           Vector3 _position, Quaternion?_rotation = null, Vector3?_scale = null)
        {
            this.Character       = _character;
            this.CharacterScript = _characterScript;

            this.Trans.localPosition = _position;
            this.Trans.localRotation = _rotation ?? QUATERNION_IDENTITY;
            this.Trans.localScale    = _scale ?? VECTOR3_ONE;

            this.Character.Init();

            this.SetActive(true);
        }
Esempio n. 9
0
        public RiaBullet(GameObject _go, RiaCharacterScript _script, PlayerNumber _playerNumber) : base(_go, _script, _playerNumber)
        {
            // CharacterScriptの上書き
            this.Script = _script as RiaBulletScript;

            // キャッシュと初期化
            this.colliderSupporter = this.Actor.ColliderSupporter;
            this.animator          = this.Actor.Animator;

            // パラメータ
            /// 体力
            this.HitPoint = this.Script.HitPointMax;

            /// 画面外処理
            this.areaLeftLine = (this.PlayerNumber == PlayerNumber.player1) ?
                                PlayableArea.pl1AreaLeftLine :
                                PlayableArea.pl2AreaLeftLine;
            this.areaRightLine = (this.PlayerNumber == PlayerNumber.player1) ?
                                 PlayableArea.pl1AreaRightLine :
                                 PlayableArea.pl2AreaRightLine;

            // タグ
            this.playerTag = (this.PlayerNumber == PlayerNumber.player1) ?
                             TagEnum.Player1.ToDescription() :
                             TagEnum.Player2.ToDescription();
            this.playerBulletTag = (this.PlayerNumber == PlayerNumber.player1) ?
                                   TagEnum.PlayerBullet1.ToDescription() :
                                   TagEnum.PlayerBullet2.ToDescription();
            this.enemyTag = (this.PlayerNumber == PlayerNumber.player1) ?
                            TagEnum.Enemy1.ToDescription() :
                            TagEnum.Enemy2.ToDescription();
            this.enemyBulletTag = (this.PlayerNumber == PlayerNumber.player1) ?
                                  TagEnum.EnemyBullet1.ToDescription() :
                                  TagEnum.EnemyBullet2.ToDescription();

            // collider
            this.Actor.GetComponent <CapsuleCollider2D>().size = this.Script.ColliderSize;
        }
Esempio n. 10
0
        public RiaEnemy(GameObject _go, RiaCharacterScript _script, PlayerNumber _playerNumber) : base(_go, _script, _playerNumber)
        {
            // CharacterScriptの上書き
            this.Script = _script as RiaEnemyScript;

            // キャッシュと初期化
            this.spRender        = this.Go.GetComponent <SpriteRenderer>();
            this.spRender.sprite = this.Script.Sprite;

            this.collider           = this.Go.GetComponent <Collider2D>();
            this.collider.isTrigger = true;

            this.colliderSupporter = this.Actor.ColliderSupporter;

            this.bulletManager = GameManager.Instance.GetEnemyBulletActorManager(this.PlayerNumber);

            // パラメータ
            /// 体力
            this.HitPoint = this.Script.HitPointMax;

            /// 画面外処理
            this.areaLeftLine = (this.PlayerNumber == PlayerNumber.player1) ?
                                PlayableArea.pl1AreaLeftLine :
                                PlayableArea.pl2AreaLeftLine;
            this.areaRightLine = (this.PlayerNumber == PlayerNumber.player1) ?
                                 PlayableArea.pl1AreaRightLine :
                                 PlayableArea.pl2AreaRightLine;

            // タグ
            this.playerTag = (this.PlayerNumber == PlayerNumber.player1) ?
                             TagEnum.Player1.ToDescription() :
                             TagEnum.Player2.ToDescription();
            this.playerBulletTag = (this.PlayerNumber == PlayerNumber.player1) ?
                                   TagEnum.PlayerBullet1.ToDescription() :
                                   TagEnum.PlayerBullet2.ToDescription();
        }
Esempio n. 11
0
        public RiaPlayer(GameObject _go, RiaCharacterScript _script, PlayerNumber _playerNumber) : base(_go, _script, _playerNumber)
        {
            // CharacterScriptの上書き
            this.Script = _script as RiaPlayerScript;

            // キャッシュ
            this.spRender        = this.Go.GetComponent <SpriteRenderer>();
            this.spRender.sprite = this.Script.Sprite;

            this.colliderSupporter = this.Actor.ColliderSupporter;

            this.circleCollider        = this.Go.GetComponent <CircleCollider2D>();
            this.circleCollider.radius = this.Script.CircleColliderRadius;
            this.animator = this.Actor.Animator;
            RiaSpriteAnimation[] anims =
            {
                GameObject.Instantiate <RiaSpriteAnimation>(this.Script.WaitAnimation),
                GameObject.Instantiate <RiaSpriteAnimation>(this.Script.RightGoAnimation),
                GameObject.Instantiate <RiaSpriteAnimation>(this.Script.LeftGoAnimation),
            };
            this.animator.SetAnimations(anims, this.Script.WaitAnimation.KeyName);

            this.bulletManger = null;

            this.rivalPlayer = null;

            // パラメータ
            /// 体力系
            this.HitPoint = this.Script.HitPointMax;

            /// 移動速度系
            this.MoveSpeedDebuffRate = 1.0f;

            /// タグ
            this.enemyTag = (this.PlayerNumber == PlayerNumber.player1) ?
                            TagEnum.Enemy1.ToDescription() :
                            TagEnum.Enemy2.ToDescription();
            this.enemyBulletTag = (this.PlayerNumber == PlayerNumber.player1) ?
                                  TagEnum.EnemyBullet1.ToDescription() :
                                  TagEnum.EnemyBullet2.ToDescription();

            /// 画面外処理
            this.areaLeftLine = (this.PlayerNumber == PlayerNumber.player1) ?
                                PlayableArea.pl1AreaLeftLine :
                                PlayableArea.pl2AreaLeftLine;
            this.areaRightLine = (this.PlayerNumber == PlayerNumber.player1) ?
                                 PlayableArea.pl1AreaRightLine :
                                 PlayableArea.pl2AreaRightLine;

            /// 無敵
            this.invincibleElapsedTime      = 0;
            this.invincibleBlinkingWaitTime = 0;
            this.sprCore         = this.Trans.GetChild(0).GetComponent <SpriteRenderer>();
            this.SpriteAlpha     = 1;
            this.CoreSpriteAlpha = 1;

            /// フレームレートとフレーム時間の算出 by flanny
            var frameRate = (float)Application.targetFrameRate;

            if (frameRate < 0)
            {
                frameRate = (QualitySettings.vSyncCount == 2) ? 30f : 60f;
            }
            var frameTime = 1.0f / frameRate;

            /// 次のコマへ進めるまでの待ち時間の設定 by flanny
            this.invincibleBlinkingWaitTimeMax =
                frameTime * this.Script.InvincibleBlinkingUpdateFrame;
        }
        // パラメータ

        public RiaEnemyBullet(GameObject _go, RiaCharacterScript _script, PlayerNumber _playerNumber) : base(_go, _script, _playerNumber)
        {
            // RiaCharacterの上書き
            this.Script = _script as RiaEnemyBulletScript;
        }
Esempio n. 13
0
        public void Create(PlayerNumber _playerNumber, RiaActor _actor,
                           Vector3 _position, Quaternion?_rotation = null, Vector3?_scale = null)
        {
            var playerCharacter = (_playerNumber == PlayerNumber.player1) ?
                                  GameManager.Instance.CommonData.playerCharacter1 :
                                  GameManager.Instance.CommonData.playerCharacter2;

            RiaCharacter       character = null;
            RiaCharacterScript script    = null;

            switch (playerCharacter)
            {
            case PlayerCharacterEnum.airos:
                script    = this.catalog.airosScript;
                character = new AirosPlayer(_actor.gameObject, script, _playerNumber);
                break;

            case PlayerCharacterEnum.anoma:
                script    = this.catalog.anomaScript;
                character = new AnomaPlayer(_actor.gameObject, script, _playerNumber);
                break;

            case PlayerCharacterEnum.emilia:
                break;

            case PlayerCharacterEnum.held:
                script    = this.catalog.heldScript;
                character = new HeldPlayer(_actor.gameObject, script, _playerNumber);
                break;

            case PlayerCharacterEnum.kaito:
                script    = this.catalog.kaitoScript;
                character = new FakeKaitoPlayer(_actor.gameObject, script, _playerNumber);
                break;

//				case PlayerCharacterEnum.kaito:
//					script = this.catalog.kaitoScript;
//					character = new KaitoPlayer(_actor.gameObject, script, _playerNumber);
//					break;

            case PlayerCharacterEnum.kaoru:
                script    = this.catalog.kaoruScript;
                character = new KaoruPlayer(_actor.gameObject, script, _playerNumber);
                break;

            case PlayerCharacterEnum.laxa:
                break;

            case PlayerCharacterEnum.twist:
                script    = this.catalog.twistScript;
                character = new TwistPlayer(_actor.gameObject, script, _playerNumber);
                break;

            case PlayerCharacterEnum.vega_al:
                break;

            case PlayerCharacterEnum.veronica:
                script    = this.catalog.veronicaScript;
                character = new VeronicaPlayer(_actor.gameObject, script, _playerNumber);
                break;

            default:
                Debug.LogError("存在しないキャラクターが選択されています");
                break;
            }

            if (character == null || !script)
            {
                Debug.LogError("Player[ " + playerCharacter + " ]が正常に生成されませんでした");
                return;
            }

            _actor.WakeUp(character, script, _position, _rotation, _scale);
        }