public void Initialize(PlayerInventory Owner, PickupManager Manager)
 {
     //this.Owner = Owner;
     this.Manager     = Manager;
     itemImage.sprite = TheRunGameManager.Instance.PowerupsData.Data[(int)_ItemID].ItemSprite;
     UpdateSlotUI();
 }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     pickupManager = GetComponent<PickupManager>();
     ResumeGame();
     cameraBoundsHalfWidth = Mathf.Abs((cam.camera.ScreenToWorldPoint(new Vector3(Screen.width,0,1)) - cam.camera.ScreenToWorldPoint(Vector3.up)).x) / 2;
     cameraBoundsHalfHeight = Mathf.Abs((cam.camera.ScreenToWorldPoint(new Vector3(0,Screen.height,1)) - cam.camera.ScreenToWorldPoint(Vector3.up)).z) / 2;
 }
    // Initial connection.
    void Start()
    {
        // Initialise map feature managers.
        obstacleManager    = new ObstacleManager();
        scorePointManager  = new ScorePointManager();
        healthPointManager = new HealthPointManager();
        pickupManager      = new PickupManager();

        // Initialise dictionary.
        mapFeatureManagers = new Dictionary <string, MapFeatureManager>();
        mapFeatureManagers.Add(mapFeatureNames[0], obstacleManager);
        mapFeatureManagers.Add(mapFeatureNames[1], scorePointManager);
        mapFeatureManagers.Add(mapFeatureNames[2], healthPointManager);
        mapFeatureManagers.Add(mapFeatureNames[3], pickupManager);

        // Initialise player manager.
        playerManager = new PlayerManager();

        if (Application.platform == RuntimePlatform.WebGLPlayer)
        {
            // Ask the browsers for setup calls.
            // (See unity.html for clarifications.)
            Debug.Log("Sending message to WebGLPlayer.");
            Application.ExternalCall("SendAllConnect");
        }
        else
        {
            // TEMPORARY. Just for testing. Connect directly. Assume id = 1.
            EstablishConnection();
            SetUserId(1);
        }

        startTime = Time.time;
        dataQueue = new Queue <JSONNode>();
    }
Beispiel #4
0
 // Use this for initialization
 void Start()
 {
     pickupManager = GameObject.Find("GameManager").GetComponent<PickupManager>();
     pickupInfo.graphic = graphic;
     pickupInfo.count = count;
     pickupInfo.score = score;
     pickupInfo.type = type;
 }
 public void Init( int weaponIdx, PickupManager manager )
 {
     active = true;
     if( particles == null ) particles = GetComponent<ParticleSystem>();
     if( particles.isStopped ) particles.Play(); // restart particle system if necessary
     myWeapon = weaponIdx;
     myManager = manager;
 }
Beispiel #6
0
        private void Start()
        {
            playerManager = GetComponent <PlayerManager>();

            #region add by ZQF
            pickupManager = GetComponent <PickupManager>();
            #endregion
        }
 void Awake()
 {
     Messenger.AddListener(typeof(StageCreatedMessage),HandleStageCreatedMessage);
     Messenger.AddListener(typeof(ColorMessage),HandleColorMessage);
     Messenger.AddListener(typeof(PickupCollectedMessage), HandlePickupCollectedMessage);
     Messenger.AddListener(typeof(BlissedOutMessage),HandleBlissedOutMessage);
     if (instance == null)
         instance = this;
 }
Beispiel #8
0
 // Use this for initialization
 public override void Start()
 {
     base.Start();
     GetComponent <ScoreGUI>().SetMedalRequirements(bronzeMedalScore, silverMedalScore, goldMedalScore);
     pickupManager = GetComponent <PickupManager>();
     ResumeGame();
     cameraBoundsHalfWidth  = Mathf.Abs((cam.camera.ScreenToWorldPoint(new Vector3(Screen.width, 0, 1)) - cam.camera.ScreenToWorldPoint(Vector3.up)).x) / 2;
     cameraBoundsHalfHeight = Mathf.Abs((cam.camera.ScreenToWorldPoint(new Vector3(0, Screen.height, 1)) - cam.camera.ScreenToWorldPoint(Vector3.up)).z) / 2;
 }
Beispiel #9
0
    void Awake()
    {
        if (Instance != null && Instance != this) {
            Destroy(gameObject);
            return;
        }

        Instance = this;

        //don't destroy between scenes
        DontDestroyOnLoad (gameObject);
    }
 // Use this for initialization
 void Awake()
 {
     _Health = MaxHealth;
     _healthbarManager = GameObject.Find("HealthbarCanvas");
     if (!_healthbarManager)
         CreateHealthBarManager ();
     _waveManager = GameObject.Find("WaveManager").GetComponent<WaveManager>();
     _scoreManager = GameObject.Find("ScoreManager").GetComponent<ScoreManager>();
     _pickupManager = GameObject.Find("PickupManager").GetComponent<PickupManager>();
     _DeathHandler = GetComponent<CharacterDeath> ();
     if (_DeathHandler == null) {
         Debug.LogWarning("<CharacterHealth[Awake]>: "+gameObject.name+" has no death handler, adding default");
         _DeathHandler=(CharacterDeath)gameObject.AddComponent<GenericDeath>();
     }
 }
Beispiel #11
0
    void Start()
    {
        if (transform.parent.GetComponentsInChildren<BallManager>().Any((other) => other.number == number && other.size > size && other.Enabled))
        {
            Destroy(gameObject);
            return;
        }

        gameManager = GameObject.Find("GameManager");
        pickupManager = gameManager.GetComponent<PickupManager>();
        player = transform.parent;
        playerBall = gameObject;
        playerManager = player.Find("PlayerManager").GetComponent<PlayerManager>();
        rigidBody = GetComponent<Rigidbody>();
        cloth = transform.Find("Cloth").gameObject;
        charge = transform.Find("Charge_01.1").gameObject;

        displayRadius = radius;
        transform.localScale = new Vector3(displayRadius, displayRadius, displayRadius);
        cloth.GetComponent<Cloth>().enabled = true;
        GetComponent<SphereCollider>().enabled = true;
        SelfColliderEnabled = false;
        MovementEnabled = false;
    }