// Use this for initialization void Awake() { CenterProcess = GameObject.Find("CenterProcess").GetComponent <CenterProcess>(); _state = this.gameObject.GetComponent <State>(); _state.Maxhealth += UpgradeTree.PlayerArchive.ExtraCastleHpLevel * SystemOption.ExCastleHpPerL; _state.Health += UpgradeTree.PlayerArchive.ExtraCastleHpLevel * SystemOption.ExCastleHpPerL; CenterProcess.SetTargetState(this.gameObject); }
// Use this for initialization void Awake() { _anime = GetComponent <Animator>(); CenterProcess = GameObject.Find("CenterProcess").GetComponent <CenterProcess>(); _gunsprite = GunShow.GetComponent <SpriteRenderer>(); _state = this.gameObject.GetComponent <State>(); _bag = this.gameObject.GetComponent <PlayerBag>(); _shootDirection = GunShow.GetComponent <ShootDirection>(); _bag.init(); _state.Maxhealth += UpgradeTree.PlayerArchive.ExtraHpLevel * SystemOption.ExPlayerHpPerL; _state.Health += UpgradeTree.PlayerArchive.ExtraHpLevel * SystemOption.ExPlayerHpPerL; _state.Armor += UpgradeTree.PlayerArchive.ExtraArmorLevel * SystemOption.ExPlayerArmorPerL; this.gameObject.transform.localScale = new Vector3(-_playerFlipScale, _playerFlipScale, _playerFlipScale); }
void Start() { _rb = GetComponent <Rigidbody2D>(); CenterProcess = GameObject.Find("CenterProcess").GetComponent <CenterProcess>(); _anime = GetComponent <Animator>(); //获取动画 _buffRender = BuffSprite.GetComponent <SpriteRenderer>(); if (gameObject.CompareTag("Monster")) //如果单位的Tag为Monster,则向CenterProcess执行添加怪物数量操作(用于当前怪物数量统计面板) { CenterProcess._monsterCol++; } _internalBuffState = new NormalBuffState(this); //初始化Buff状态 if (IsAvatar) //如果当前无敌开关开启则直接转向无敌Buff状态 { _internalBuffState = new AvatarBuffState(this); } StartCoroutine(BuffDamage()); //初始化计算Buff伤害的协程 }
public void UpdateData(CenterProcess centerProcess) { _monsterCol = centerProcess.MonsterCol; Display(); }
public void UpdateData(CenterProcess centerProcess) { _state = centerProcess.PlayerState; _gun = centerProcess.Gun; Display(); }
public void UpdateData(CenterProcess centerProcess) { _gun = centerProcess.Gun; Display(); }
public void UpdateData(CenterProcess centerProcess) { _coinCol = centerProcess.IntervalCoins; Display(); }
public void UpdateData(CenterProcess centerProcess) { _localist = centerProcess.Killerlist; Display(); }
public void UpdateData(CenterProcess centerProcess) { _bag = centerProcess.Bag; Display(); }
public void UpdateData(CenterProcess centerProcess) { _coins = centerProcess.IntervalCoins; _killingNum = centerProcess.KillingNum; Display(); }