Example #1
0
        public GameObject getGameObject(GameObject parent)
        {
            GameObject prefab = YellowPageUtils.GetSourceObject(yellowPage, this.prefabID);
            GameObject result = GameObject.Instantiate(prefab, parent.transform);

            return(result);
        }
Example #2
0
    private void ProcessUseless()
    {
        StartLoopTrigger start = _StartTrigger.First().GetComponent <StartLoopTrigger>();

        foreach (GameObject go in _ToRepop)
        {
            GameObjectManager.addComponent <Removed>(go);

            Origin origin          = go.GetComponent <Origin>();
            YellowPageComponent yp = _YellowPages.First().GetComponent <YellowPageComponent>();
            start.deckPool.Add(YellowPageUtils.GetSourceObject(yp, origin.sourceObjectKey));
        }
    }
Example #3
0
    private void Replicate(Bacteria bacteria)
    {
        // Replication
        if (bacteria.replicationCooldown <= 0 && _Active.Count < MAX_NB_OF_BACTERIAS)
        {
            // Create new fresh bacteria
            Origin     origin = bacteria.gameObject.GetComponent <Origin>();
            GameObject clone  = Object.Instantiate(YellowPageUtils.GetSourceObject(holder, origin.sourceObjectKey));
            clone.transform.position = bacteria.transform.position;

            // Bind it to FYFY
            GameObjectManager.bind(clone);

            // Reset cooldown
            bacteria.replicationCooldown = bacteria.replicationDelay;
        }
        else
        {
            bacteria.replicationCooldown -= Time.deltaTime;
        }
    }