コード例 #1
0
	public CharacterBase(GameObject This)
	{
		characterObj = This;
		UpBody = This.transform.Find("UpBody").gameObject;
		DownCollider = This.transform.Find("DownCollider").gameObject;
		UpperAnim = This.transform.Find("UpBody/Upper").GetComponent<Animation>();
		FeetAnim = This.transform.Find("UpBody/Upper/Feet").GetComponent<Animation>();
		HeadSprite = This.transform.Find("UpBody/Upper/Head").GetComponent<SpriteRenderer>();
		BodySprite = This.transform.Find("UpBody/Upper/Body").GetComponent<SpriteRenderer>();
		characterAttributes = This.GetComponent<CharacterAttributes>();
		localEventManager = This.GetComponent<CharacterManager>().localEventManager;
		equipmentStatus = new EquipmentStatus("EmptyHand","Small"){Range=new Vector2(1,1)};
		characterStatus = new InAir(this,"Normal");
		characterStatus.Enter();
		EventManager.eventManager.DamageCheckEvent+=DamageCheck;
		localEventManager.ChangeToAirEvent+=ChangeToAir;
		localEventManager.ChangeToGroundEvent+=ChangeToGround;
		localEventManager.JumpEvent += Jump;
		localEventManager.MoveEvent += Move;
		localEventManager.AttackEvent += Attack;
		localEventManager.JumpLeftwardEvent += JumpLeftward;
		localEventManager.JumpRightwardEvent += JumpRightward;
		localEventManager.DodgeLeftwardEvent += DodgeLeftward;
		localEventManager.DodgeRightwardEvent += DodgeRightward;
		localEventManager.ThrowLeftwardEvent += ThrowLeftward;
		localEventManager.ThrowRightwardEvent += ThrowRightward;
		localEventManager.SpecialLeftwardEvent += SpecialLeftward;
		localEventManager.SpecialRightwardEvent += SpecialRightward;
	}
コード例 #2
0
    public void ChangeToAir()
    {
        string status = characterStatus.Exit();

        characterStatus = new InAir(this, status);
        characterStatus.Enter();
    }
コード例 #3
0
    public void ChangeToGround()
    {
        string status = characterStatus.Exit();

        characterStatus = new OnGround(this, status);
        characterStatus.Enter();
    }
コード例 #4
0
 public CharacterBase(GameObject This)
 {
     characterObj        = This;
     UpBody              = This.transform.Find("UpBody").gameObject;
     DownCollider        = This.transform.Find("DownCollider").gameObject;
     UpperAnim           = This.transform.Find("UpBody/Upper").GetComponent <Animation>();
     FeetAnim            = This.transform.Find("UpBody/Upper/Feet").GetComponent <Animation>();
     HeadSprite          = This.transform.Find("UpBody/Upper/Head").GetComponent <SpriteRenderer>();
     BodySprite          = This.transform.Find("UpBody/Upper/Body").GetComponent <SpriteRenderer>();
     characterAttributes = This.GetComponent <CharacterAttributes>();
     localEventManager   = This.GetComponent <CharacterManager>().localEventManager;
     equipmentStatus     = new EquipmentStatus("EmptyHand", "Small")
     {
         Range = new Vector2(1, 1)
     };
     characterStatus = new InAir(this, "Normal");
     characterStatus.Enter();
     EventManager.eventManager.DamageCheckEvent += DamageCheck;
     localEventManager.ChangeToAirEvent         += ChangeToAir;
     localEventManager.ChangeToGroundEvent      += ChangeToGround;
     localEventManager.JumpEvent             += Jump;
     localEventManager.MoveEvent             += Move;
     localEventManager.AttackEvent           += Attack;
     localEventManager.JumpLeftwardEvent     += JumpLeftward;
     localEventManager.JumpRightwardEvent    += JumpRightward;
     localEventManager.DodgeLeftwardEvent    += DodgeLeftward;
     localEventManager.DodgeRightwardEvent   += DodgeRightward;
     localEventManager.ThrowLeftwardEvent    += ThrowLeftward;
     localEventManager.ThrowRightwardEvent   += ThrowRightward;
     localEventManager.SpecialLeftwardEvent  += SpecialLeftward;
     localEventManager.SpecialRightwardEvent += SpecialRightward;
 }
コード例 #5
0
	public void ChangeToAir()
	{
		string status = characterStatus.Exit();
		characterStatus = new InAir(this,status);
		characterStatus.Enter();
	}
コード例 #6
0
	public void ChangeToGround()
	{
		string status = characterStatus.Exit();
		characterStatus = new OnGround(this,status);
		characterStatus.Enter();
	}