Beispiel #1
0
    public void ReturnTail(tail tail)
    {
        _stack_Tail.Push(tail);

        if (tail.gameObject.activeSelf)
        {
            tail.gameObject.SetActive(false);
        }
    }
Beispiel #2
0
 private void MakeTail(int count)
 {
     for (int i = 0; i < count; i++)
     {
         tail tail = Instantiate(tailPrefab);
         _stack_Tail.Push(tail);
         tail.gameObject.SetActive(true);
         tail.transform.SetParent(tailParent);
     }
 }
Beispiel #3
0
    // -----------------------------------------------------------------------------------------------------------------
    // STATIC
    public static tail Instantiate(tail.CConfig config, string name, path path_obj, level level_obj)
    {
        tail obj = utils.Instantiate(null, name).AddComponent <tail>();

        obj.m_config      = config;
        obj.m_level       = level_obj;
        obj.m_level_tags  = level_obj.GetTagOwner();
        obj.m_path        = path_obj;
        obj.m_segment_len = config.mesh.GetBounds().z;
        obj.m_segments    = new LinkedList <GameObject>();

        return(obj);
    }
Beispiel #4
0
    public tail GetTail(int tailSpriteIdx = 0)
    {
        int len = _stack_Tail.Count;

        if (len == 0)
        {
            MakeTail(1);
        }

        tail newTail = _stack_Tail.Pop();

        newTail.gameObject.GetComponent <SpriteRenderer>().sprite = tailSprite[tailSpriteIdx];

        return(newTail);
    }
Beispiel #5
0
    public void CreateTail(Vector3 dir)
    {
        tail tail = ObjectPoolManager.instance.GetTail();

        if (first)
        {
            child                   = tail.gameObject;
            tail.parent             = gameObject;
            first                   = false;
            parentTail              = tail.gameObject;
            tail.transform.position = gameObject.transform.position + new Vector3(dir.x * padding, dir.y * padding, 0);
        }
        else
        {
            parentTail.GetComponent <tail>().child = tail.gameObject;
            tail.GetComponent <tail>().parent      = parentTail;
            tail.transform.position = parentTail.transform.position + new Vector3(-dir.x + padding, -dir.y + padding, 0);
            parentTail = tail.gameObject;
        }
        n_tail++;
        tTailNum.text = n_tail.ToString();
    }
Beispiel #6
0
    void Start()
    {
        Transform current = transform;

        for (int i = 0; i < 2; i++)
        {
            tail tail = GameObject.CreatePrimitive(PrimitiveType.Cube).AddComponent <tail>();

            tail.transform.position = current.transform.position - current.transform.forward * 2;

            tail.transform.rotation = transform.rotation;

            tail.target = current.transform;

            tail.targetDistance = 2;

            Destroy(tail.GetComponent <Collider>());

            current = tail.transform;
            //float horizontal = Input.GetAxis("Horizontal");
            // tail.transform.Rotate(10, rotationSpeed * Time.deltaTime * horizontal, 10);
        }
    }
Beispiel #7
0
 Prepend(ref head, ref tail, element, newNode);
Now the problem isn't exactly with this code but the fact that when Microsoft.Practices.EnterpriseLibrary.Data.Database class calls an intance of DbDataAdapter (tail in our case is SqlClientFactory) it creates SqlClientFactory Command, and then tries to set the Connection of this command to ProfiledDbConnection and this is were it breaks. 
 private void T_callback(tail arg1, tail.tail_event_type arg2, object data)
 {
     Console.WriteLine(data);
 }
 private void T_callback1(tail arg1, tail.tail_event_type arg2, object arg3, object arg4)
 {
     Console.WriteLine(arg3.ToString());
 }