Exemple #1
0
    private void SpawnKindomButton(Kindom k)
    {
        Button kindomButton = Instantiate(kindomButtonPrefab, kindomButtonsContainer).GetComponent <Button>();

        kindomButton.onClick.AddListener(() => LookAtKindom(k));

        kindomButton.transform.GetChild(0).GetComponentInChildren <Text>().text = k.name;
    }
Exemple #2
0
    private void SpawnKindomPoint(Kindom k)
    {
        GameObject kindom = Instantiate(kindomPointPrefab, modelTransform);

        kindom.transform.localEulerAngles = new Vector3(k.y + visualOffset.y, -k.x - visualOffset.x, 0);
        k.visulaPoint = kindom.transform.GetChild(0);

        SpawnKindomButton(k);
    }
Exemple #3
0
    public void LookAtKindom(Kindom k)
    {
        Transform cameraParent = Camera.main.transform.parent;
        Transform cameraPivot  = cameraParent.parent;

        cameraParent.DOLocalRotate(new Vector3(k.y, 0, 0), lookDuration, RotateMode.Fast).SetEase(lookEase);
        cameraPivot.DOLocalRotate(new Vector3(0, -k.x, 0), lookDuration, RotateMode.Fast).SetEase(lookEase);

        FindObjectOfType <FollowTarget>().target = k.visulaPoint;
    }