Пример #1
0
    // Cell이 터치 되었을때 호출하는 함수
    public void DidSelectCell(Cell cell)
    {
        if (contacts.HasValue)
        {
            int cellIndex = cellList.IndexOf(cell);

            DetailViewManager detailViewManager
                = Instantiate(detailViewPrefab).GetComponent <DetailViewManager>();

            Contact selectedContact = contacts.Value.contactList[cellIndex];
            detailViewManager.contact = selectedContact;

            detailViewManager.saveDelegate = (newContact) =>
            {
                contacts.Value.contactList[cellIndex] = newContact;

                cell.Title = newContact.name;
                cell.ProfilePhotoSprite = SpriteManager.GetSprite(newContact.profilePhotoFileName);

                //ClearCell();
                //LoadData();
            };

            mainManager.PresentViewManager(detailViewManager);
        }
    }
Пример #2
0
    // Cell이 터치 되었을때 호출하는 함수
    public void DidSelectCell(Cell cell)
    {
        if (contacts.HasValue)
        {
            int cellIndex = cellList.IndexOf(cell);

            DetailViewManager detailViewManager
                = Instantiate(detailViewPrefab).GetComponent <DetailViewManager>();

            Contact selectedContact = contacts.Value.contactList[cellIndex];
            detailViewManager.contact = selectedContact;

            detailViewManager.saveDelegate = (newContact) =>
            {
                contacts.Value.contactList[cellIndex] = newContact;

                cell.Name        = newContact.name;
                cell.PhoneNuber  = newContact.phoneNumber;
                cell.Email       = newContact.email;
                cell.Icon.sprite = newContact.sp;
                //ClearCell();
                //LoadData();
            };

            mainManager.PresentViewManager(detailViewManager);
        }
    }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        global_animator = GameObject.Find("DisplayArea").GetComponent <Animator>();
        server          = GameObject.Find("DisplayArea/Database/Server").GetComponent <Server>();
        returnButton.onClick.AddListener(onReturnClick);

        detailViewmanager = GameObject.Find("DisplayArea/DetailView").GetComponent <DetailViewManager>();

        V001.GetComponent <Button>().onClick.AddListener(() => {
            detailViewmanager.SetCurrentComponent("V001");
            global_animator.SetTrigger("Plant2Detail");
        });

        V002.GetComponent <Button>().onClick.AddListener(() => {
            detailViewmanager.SetCurrentComponent("V002");
            global_animator.SetTrigger("Plant2Detail");
        });

        T001.GetComponent <Button>().onClick.AddListener(() => {
            detailViewmanager.SetCurrentComponent("T001");
            global_animator.SetTrigger("Plant2Detail");
        });

        T002.GetComponent <Button>().onClick.AddListener(() => {
            detailViewmanager.SetCurrentComponent("T002");
            global_animator.SetTrigger("Plant2Detail");
        });

        M001.GetComponent <Button>().onClick.AddListener(() => {
            detailViewmanager.SetCurrentComponent("M001");
            global_animator.SetTrigger("Plant2Detail");
        });

        P001.GetComponent <Button>().onClick.AddListener(() => {
            detailViewmanager.SetCurrentComponent("P001");
            global_animator.SetTrigger("Plant2Detail");
        });
    }