Пример #1
0
        public void Init(ProjectilesManager pm)
        {
            DontDestroyOnLoad(this.gameObject);

            rigidbody  = GetComponent <Rigidbody2D>();
            animator   = GetComponent <Animator>();
            talkCanvas = transform.Find("Canvas").gameObject;
            talkText   = talkCanvas.transform.Find("Panel").Find("PlaceholderText").GetComponentInChildren <pokemonBattle.Textshadow>();

            interactionCollider = transform.Find(INTERACTION_COLLIDER).GetComponent <Collider2D>();
            interactionRange    = interactionCollider.transform.localPosition.magnitude;

            projectilesManager = pm;

            RpgManager.HUD.UpdateHearts(pv, 3, true);
        }
Пример #2
0
        private void Awake()
        {
            if (Instance == null)
            {
                RpgManager.Instance = this;

                RpgManager.CameraManager = cameraManager;
                RpgManager.Ennemies      = ennemies;
                RpgManager.Player        = player;
                RpgManager.Projectiles   = projectiles;
                RpgManager.Interaction   = interaction;
                RpgManager.HUD           = hud;

                DontDestroyOnLoad(gameObject);
            }
            else
            {
                //RpgManager.SceneJustLoaded = true;
                RpgManager.Instance.StartCoroutine(RpgManager.Instance.FinishLoadSceneCoroutine(RpgManager.Spawn));
                Destroy(gameObject);
            }
        }