void Start() { transform.position = new Vector3(0, -2f, 0); _spawnManager = GameObject.Find("Spawn_Manager").GetComponent <SpawnManager>(); _uiManager = GameObject.Find("Canvas").GetComponent <UIMananger>(); _laserAudioSource = GetComponent <AudioSource>(); _playerAnim = GetComponent <Animator>(); _shieldAlpha = _shieldEffect.GetComponent <SpriteRenderer>().color; _cameraShaker = GameObject.Find("Main Camera").GetComponent <CameraShaker>(); _originSpeed = _speed; if (_spawnManager == null) { Debug.LogError("Spawn Manager is missing!"); } if (_uiManager == null) { Debug.LogError("UIManager is missing!"); } if (_laserAudioSource == null) { Debug.LogError("LaserAudioSource is missing!"); } else { _laserAudioSource.clip = _laserAudioClip; } if (_cameraShaker == null) { Debug.LogError("CameraShaker is missing!"); } }
public BasePanel(string packageName, UIPanelType uiPanelType, UIMananger uiManager) { this.packageName = packageName; currentUIPanelType = uiPanelType; this.uiManager = uiManager; UIPackage.AddPackage("UI/" + packageName); }
private void Awake() { DontDestroyOnLoad(this.gameObject); Instance = this; //加载资源包 UIPackage.AddPackage("UI/Res_Main"); UIPackage.AddPackage("UI/Res_Game"); UIPackage.AddPackage("UI/Res_Component"); UIConfig.defaultFont = "汉仪南宫体简"; UIConfig.buttonSound = buttonSound; GRoot.inst.SetContentScaleFactor(1600, 900, UIContentScaler.ScreenMatchMode.MatchWidthOrHeight); if (currentUIManager == null) { currentUIManager = new UIMananger(); currentUIManager.MainUIManager(); } if (audioSourceManager == null) { audioSourceManager = new AudioSourceManager(this); } if (messageManager == null) { messageManager = new MessageManager(); messageManager.InitMessage(); } }
public GameBasePanel(string packageName, UIPanelType uiPanelType, UIMananger uiManager) : base(packageName, uiPanelType, uiManager) { messageManager = GameManager.Instance.messageManager; if (uiPanelType == UIPanelType.DayNightPanel) { isDayNightPanel = true; } }
void Start() { _currentWave = 0; _uiManager = GameObject.Find("Canvas").GetComponent <UIMananger>(); if (_uiManager == null) { Debug.LogError("UIManager couldn't locate!"); } }
// Start is called before the first frame update void Start() { _player = GameObject.Find("Player"); if (_player == null) { Debug.LogError("Player is missing!"); } _uiManager = GameObject.Find("Canvas").GetComponent <UIMananger>(); if (_uiManager == null) { Debug.LogError("UI is mission"); } _anim = GetComponent <Animator>(); GetComponent <CircleCollider2D>().enabled = false; StartCoroutine(MovementIDSwitcher()); StartCoroutine(XAxisSwitcher()); StartCoroutine(AttackIDSwitcher()); Invoke("AttackASwitch", 6f); Invoke("AttackBSwitch", 8f); }
public SetPanel(string packageName, UIPanelType uiPanelType, UIMananger uiManager) : base(packageName, uiPanelType, uiManager) { }
public void Awake() { _instance = this; }