Example #1
0
        public static CtrlSortieResult Instantiate(CtrlSortieResult prefab, Transform parent, List <MapEventItemModel> items, Action onDecide)
        {
            CtrlSortieResult ctrlSortieResult = InstantiateObject <CtrlSortieResult> .Instantiate(prefab, parent);

            ctrlSortieResult.Init(items, onDecide);
            return(ctrlSortieResult);
        }
        public static ProdBattleCommandBuffer Instantiate(ProdBattleCommandBuffer prefab, Transform parent, EffectModel buffer, int nBufferCnt)
        {
            ProdBattleCommandBuffer prodBattleCommandBuffer = InstantiateObject <ProdBattleCommandBuffer> .Instantiate(prefab, parent);

            prodBattleCommandBuffer.Init(buffer, nBufferCnt);
            return(prodBattleCommandBuffer);
        }
Example #3
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (GetComponentInChildren <ParticleSystem>() != null)
        {
            GetComponentInChildren <ParticleSystem>().Play();
        }
        noCollision = false;

        InstantiateObject inst = GetComponent <InstantiateObject>();

        if (inst != null)
        {
            if (collision.gameObject.GetComponent <TilemapCollider2D>() != null)
            {
                ContactPoint2D[] contact = new ContactPoint2D[1];
                collision.GetContacts(contact);

                if (contact[0].normal.y > 0)
                {
                    Vector2 hitPoint = new Vector2(contact[0].point.x, contact[0].point.y + 0.25f);
                    if (hitPoint.y < transform.position.y)
                    {
                        //Instantiate(explosion, new Vector3(hitPoint.x, hitPoint.y, 0), Quaternion.identity);
                        inst.Instantiate(hitPoint);
                        Invoke("DestroyThis", 0.4f);
                    }
                }
            }

            else
            {
                ContactPoint2D[] contact = new ContactPoint2D[1];
                collision.GetContacts(contact);

                if (contact[0].normal.y > 0)
                {
                    inst.Instantiate(new Vector2(contact[0].point.x, contact[0].point.y + 0.4f));
                    Invoke("DestroyThis", 0.4f);
                }
            }
        }

        else
        {
            Destroy(gameObject);
        }
    }
        public static UIBufferFleetCircle Instantiate(UIBufferFleetCircle prefab, Transform parent, FleetType iType)
        {
            UIBufferFleetCircle uIBufferFleetCircle = InstantiateObject <UIBufferFleetCircle> .Instantiate(prefab, parent);

            uIBufferFleetCircle.transform.localScale = new Vector3(uIBufferFleetCircle._fCircleScale, 0f, uIBufferFleetCircle._fCircleScale);
            uIBufferFleetCircle.Init(iType);
            return(uIBufferFleetCircle);
        }
Example #5
0
    public static T Instantiate(T prefab, Transform parent)
    {
        T result = InstantiateObject <T> .Instantiate(prefab);

        result.get_transform().set_parent(parent);
        result.get_transform().localScaleOne();
        result.get_transform().localPositionZero();
        return(result);
    }
        public static UIBufferCircle Instantiate(UIBufferCircle prefab, Transform parent, FleetType iType, Transform target)
        {
            UIBufferCircle uIBufferCircle = InstantiateObject <UIBufferCircle> .Instantiate(prefab);

            uIBufferCircle.get_transform().set_localScale(new Vector3(uIBufferCircle._fCircleScale, 0f, uIBufferCircle._fCircleScale));
            uIBufferCircle.get_transform().set_parent(parent);
            uIBufferCircle.get_transform().localPositionZero();
            uIBufferCircle.get_transform().set_rotation(new Quaternion(0f, 0f, 0f, 0f));
            uIBufferCircle.Init(iType, target);
            return(uIBufferCircle);
        }
Example #7
0
 public static T Instantiate(T prefab, Transform parent, params object[] param)
 {
     return(InstantiateObject <T> .Instantiate(prefab, parent));
 }