示例#1
0
 // Start is called before the first frame update
 void Start()
 {
     gl = MapController.currentMap.GetComponent <GridLayout>();
     transform.position = new Vector3(transform.position.x, transform.position.y, transform.position.z);
     playerMovement     = new PlayerMovement(transform, GetComponent <Animator>());
     playerMovement.SetPlayerSpeed(player.speed);
     playerMovement.SetActualSpeed(player.speed);
     playerMovement.SetRunningSpeed(player.runningSpeed);
     playerAttack = new PlayerAttack(transform, GetComponent <Animator>(), player.fireManaCost, player.waterManaCost, player.windManaCost, player.rockManaCost);
     new WaitForEndOfFrame();
     hp = player.hp;
     StartCoroutine(playerMovement.Move());
     StartCoroutine(playerAttack.AttackAnimation());
     EnemyEventsManager.Instance.onMakeDamage += TakeDamage;
     GlobalEventManager.Instance.onMapChanged += UpdateGrid;
 }