Beispiel #1
0
        public IGhostA CloneMe(Transform parent, Vector2 position)
        {
            GameObject    _gameObjectGhostA = Instantiate(gameObject, parent);
            BoxCollider2D boxCollider       = _gameObjectGhostA.AddComponent <BoxCollider2D>();

            GhostA ghostA = _gameObjectGhostA.GetComponent <GhostA>();

            _spriteRenderer = _gameObjectGhostA.GetComponent <SpriteRenderer>();
            ghostA.transform.localPosition = position;

            return(ghostA);
        }
Beispiel #2
0
        public IGhostA CloneMe(Transform parent, Vector2 position)
        {
            GameObject    newObj      = Instantiate(gameObject, parent);
            BoxCollider2D boxCollider = newObj.AddComponent <BoxCollider2D>();

            //Rigidbody2D rigid = newObj.AddComponent<Rigidbody2D>();
            GhostA ghostA = newObj.GetComponent <GhostA>();

            ghostA.transform.localPosition = position;


            return(ghostA);
        }