コード例 #1
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
コード例 #2
0
 void Start()
 {
     anim = GetComponent<Animator>();
     audio = GetComponent<AudioSource>();
     collected = false;
     manager = GameObject.FindGameObjectWithTag("CollectableManager").GetComponent<CollectableManager>();
 }
コード例 #3
0
 // Start is called before the first frame update
 void Start()
 {
     if (cManager == null)
     {
         cManager = GameObject.Find("Managers").GetComponent <CollectableManager>();
     }
 }
コード例 #4
0
 void Start()
 {
     if (cManager == null && CollectableManager._inst != null)
     {
         cManager = CollectableManager._inst;
     }
 }
コード例 #5
0
    void Start()
    {
        //Setting our references
        m_SFX = SFXManager.Instance;
        m_CollectableManager = GameObject.FindGameObjectWithTag(Constants.COLLECTABLE_MANAGER).GetComponent<CollectableManager>();

        SetOnGround();
    }
コード例 #6
0
 // Start is called before the first frame update
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
     cheatAllSouls = false;
 }
コード例 #7
0
    void Start()
    {
        //Setting our references
        m_SFX = SFXManager.Instance;
        m_CollectableManager = GameObject.FindGameObjectWithTag(Constants.COLLECTABLE_MANAGER).GetComponent <CollectableManager>();

        SetOnGround();
    }
コード例 #8
0
 public override void OnStartLocalPlayer()
 {
     base.OnStartLocalPlayer();
     // set up the variables
     currentHealth      = MAXHEALTH;
     playerController   = GetComponent <PlayerController>();
     collectableManager = GameObject.Find("collectableContainer").GetComponent <CollectableManager>();
 }
コード例 #9
0
 void Start()
 {
     // variable setup / initialization
     isObjectiveComplete = false;
     generator           = GetComponent <CollectableManager>();
     generator.Init();
     player = Instantiate(playerPrefab, new Vector3(0, 100, 0), Quaternion.identity);
     player.GetComponent <PlayerController>().levelManager = this;
 }
コード例 #10
0
 // Start is called before the first frame update
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
     gos        = GameObject.FindGameObjectsWithTag("Collectable");
     numInScene = gos.Length;
 }
コード例 #11
0
 private void Start()
 {
     CollectiblesCollected = new List <int>();
     originalPos           = transform.position;
     shaker     = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraShaker>();
     defaultRot = transform.rotation;
     rb         = GetComponent <Rigidbody>();
     Manager    = GameObject.FindGameObjectWithTag("GameManager").GetComponent <CollectableManager>();
     StartCoroutine(Manager.RegisterPlayer(Address, privateKey));
 }
コード例 #12
0
 private void Awake()
 {
     if (_instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         _instance = this;
     }
 }
コード例 #13
0
    void Awake()
    {
        worldContainer = GameObject.FindGameObjectWithTag("World");
        playerCamera   = GameObject.FindGameObjectWithTag("PlayerCamera");

        player             = FindObjectOfType <Player>();
        spawner            = GetComponent <Spawner>();
        enemySpawner       = GetComponent <EnemySpawner>();
        switchSystem       = GetComponent <SwitchSystem>();
        collectableManager = GetComponent <CollectableManager>();
    }
コード例 #14
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(gameObject);
     }
     else
     {
         _instance = this;
         //DontDestroyOnLoad(this.gameObject);
     }
 }
コード例 #15
0
    void Start()
    {
        if (CollectableManager._inst != null)
        {
            cManager = CollectableManager._inst;
        }

        if (pHandler == null)
        {
            pHandler = FindObjectOfType <PlayerStatusHandler>();
        }
    }
コード例 #16
0
    void Start()
    {
        // Grab our coin manager
        coinManager = GameObject.FindWithTag("CoinManager").GetComponent <CoinManager> ();

        // Grab our collectable manager
        collectableManager = GameObject.FindWithTag("CollectableManager").GetComponent <CollectableManager>();

        collectablePanelWindow = GameObject.Find("CollectablePanelWindow");

        // Setup the sprite image in the UI
        itemUIImage.sprite = itemSprite;
    }
コード例 #17
0
 public void Init()
 {
     // variable setup / initialization
     collectableManager = GetComponent <CollectableManager>();
     enemyManager       = GetComponent <EnemyManager>();
     maze = GetComponent <BinaryTreeMaze>();
     isObjectiveComplete = false;
     enemyManager.Init();
     collectableManager.Init();
     maze.Init();
     player.transform.position = new Vector3(1, 2, 1);
     player.GetComponent <PlayerController>().levelManager = this;
 }
コード例 #18
0
 void Awake()
 {
     // Confirm singleton instance is active
     if (_inst == null)
     {
         _inst = this;
         // DontDestroyOnLoad(this);
     }
     else if (_inst != this)
     {
         GameObject.Destroy(this.gameObject);
     }
 }
コード例 #19
0
    // Use this for initialization
    void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else if (Instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);

        checkpointResults = new List <CheckpointResult>();
    }
コード例 #20
0
ファイル: Enemy.cs プロジェクト: Brianspha/CryptoWorldWar
 // Start is called before the first frame update
 void Start()
 {
     nftManager   = GameObject.FindGameObjectWithTag("GameManager").GetComponent <CollectableManager>();
     manager      = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>();
     main         = Camera.main.GetComponent <CameraShaker>();
     ripple       = Camera.main.GetComponent <RipplePostProcessor>();
     Kills        = GameObject.FindGameObjectWithTag("Score").GetComponent <Text>();
     Description  = GameObject.FindGameObjectWithTag("Description").GetComponent <Text>();
     Name         = GameObject.FindGameObjectWithTag("Name").GetComponent <Text>();
     player       = GameObject.FindGameObjectWithTag("Player");
     playerScript = GameObject.FindGameObjectWithTag("Player").GetComponent <Player>();
     rb           = GetComponent <Rigidbody>(); currentShootTime = maxShootTime;
     defaultRot   = transform.rotation;
     originalPos  = transform.position;
     health       = Random.Range(5, 15);
 }
コード例 #21
0
ファイル: CollectableManager.cs プロジェクト: Fenyn/FPS-Game
    //public int NumOfApples {
    //    get {
    //        return numOfApples;
    //    }
    //}

    //public int NumOfBreadLoves {
    //    get {
    //        return numOfBreadLoves;
    //    }
    //}

    //public int NumOfWood {
    //    get {
    //        return numOfWood;
    //    }
    //}

    //public int NumOfMeat {
    //    get {
    //        return numOfMeat;
    //    }
    //}

    //Awake is always called before any Start functions
    void Awake()
    {
        //Check if instance already exists
        if (instance == null)
        {
            //if not, set instance to this
            instance = this;
        }
        //If instance already exists and it's not this:
        else if (instance != this)
        {
            //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager.
            Destroy(gameObject);
        }
        levelManager = GameObject.Find("LevelManager").GetComponent <LevelManager>();
        InitializePickups();
    }
コード例 #22
0
 void Start()
 {
     if (SceneManager.GetActiveScene().name == "Demo")
     {
         instance        = this;
         IsDemo          = true;
         GameMenuManager = Instantiate(GameMenuManager, instance.transform);
         GameMenuManager.transform.parent = this.transform;
         BuildingManager = Instantiate(BuildingManager, instance.transform);
         BuildingManager.transform.parent = this.transform;
         PlayerCamera = Instantiate(PlayerCamera, instance.transform);
         PlayerCamera.transform.parent       = this.transform;
         CollectableManager                  = Instantiate(CollectableManager, instance.transform);
         CollectableManager.transform.parent = this.transform;
         EnemyManager = Instantiate(EnemyManager, instance.transform);
         EnemyManager.transform.parent = this.transform;
         Player = Instantiate(Player, instance.transform);
         Player.transform.parent         = this.transform;
         TileManager                     = Instantiate(TileManager, instance.transform);
         TileManager.transform.parent    = this.transform;
         MissionManager                  = Instantiate(MissionManager, instance.transform);
         MissionManager.transform.parent = this.transform;
     }
     else
     {
         instance    = this;
         MenuManager = Instantiate(MenuManager, instance.transform);
         MenuManager.transform.parent = this.transform;
         BuildingManager = Instantiate(BuildingManager, instance.transform);
         BuildingManager.transform.parent = this.transform;
         PlayerCamera = Instantiate(PlayerCamera, instance.transform);
         PlayerCamera.transform.parent       = this.transform;
         CollectableManager                  = Instantiate(CollectableManager, instance.transform);
         CollectableManager.transform.parent = this.transform;
         EnemyManager = Instantiate(EnemyManager, instance.transform);
         EnemyManager.transform.parent = this.transform;
         Player = Instantiate(Player, instance.transform);
         Player.transform.parent      = this.transform;
         TileManager                  = Instantiate(TileManager, instance.transform);
         TileManager.transform.parent = this.transform;
     }
 }
コード例 #23
0
        public void StartTrackManager()
        {
            if (checkpoints.Count == 0)
            {
                return;
            }

            Object[] allRacerArray = FindObjectsOfType <Object> ().Where(x => x is IRacer).ToArray();

            for (int i = 0; i < allRacerArray.Length; i++)
            {
                IRacer racer = allRacerArray[i] as IRacer;
                m_RacerNextCheckpoints.Add(racer, checkpoints[0]);
                racer.DisableControl();
            }
            if (collectableManager == null)
            {
                collectableManager = GameObject.Find("CollectableManager").GetComponent <CollectableManager>();
            }
        }
コード例 #24
0
    void Awake()
    {
        // Save the original camera position
        cameraOriginalPosition = Camera.main.transform.position;

        // Make a copy of this for internal tracking
        internalShakeLength = shakeLength;

        // Find our coin manager
        coinManager = GameObject.FindWithTag("CoinManager").GetComponent <CoinManager>();

        // Find our play field
        playFieldArea = GameObject.FindWithTag("CoinsPlayField").GetComponent <Transform>();

        // Find our coin spawner
        coinSpawner = GameObject.FindWithTag("CoinSpawnerArea").GetComponent <CoinSpawner>();

        // Find the collectableManager
        collectableManager = GameObject.FindWithTag("CollectableManager").GetComponent <CollectableManager>();

        // Find the pusher
        pushBar = GameObject.FindWithTag("PushBar").GetComponent <Pusher>();
    }
コード例 #25
0
 void Start()
 {
     m_Manager = GameObject.FindGameObjectWithTag(Constants.COLLECTABLE_MANAGER).GetComponent <CollectableManager>();
 }
コード例 #26
0
 void Start()
 {
     m_Manager = GameObject.FindGameObjectWithTag(Constants.COLLECTABLE_MANAGER).GetComponent<CollectableManager>();
 }
コード例 #27
0
 void Start()
 {
     _audioSource       = GetComponent <AudioSource>();
     collectableManager = FindObjectOfType <CollectableManager>();
 }
コード例 #28
0
 void Start()
 {
     collectableManager = GameObject.Find("CollectableManager").GetComponent <CollectableManager>();
 }
コード例 #29
0
 // Use this for initialization
 void Start()
 {
     rb = GetComponent <Rigidbody>();
     _collectableManager = collectableManagerObj.GetComponent <CollectableManager>();
 }
コード例 #30
0
 void OnApplicationQuit()
 {
     s_Instance = null;
 }
コード例 #31
0
 public void Execute(CollectableManager collectableManager)
 {
     Debug.Log(collectable.name + " removed from scene");
     collectableManager.RemoveCollectable(collectable);
 }
コード例 #32
0
 public bool CanExecute(CollectableManager collectableManager)
 {
     return(true);
 }
コード例 #33
0
 // Use this for initialization
 void Start()
 {
     thisAreaTrigger    = GetComponent <AreaTrigger>();
     collectableManager = GameObject.FindGameObjectWithTag("Player").GetComponent <CollectableManager>();
 }