示例#1
0
        void Player_Effect_CallBack(object e)
        {
            try
            {
                StopEffectTimer((byte)e);

                targetObject thisObject = new targetObject(this, null);

                foreach (KeyValuePair <string, int> p in Data.SkillBase[this.Character.Action.DeBuff.Effect.SkillID[(byte)e]].Properties1)
                {
                    switch (p.Key)
                    {
                    case "fb":
                        DarkEmu_GameServer.Effect.DeleteEffect_fb(thisObject, (byte)e);
                        break;

                    case "bu":

                        break;

                    case "fz":
                        DarkEmu_GameServer.Effect.DeleteEffect_fz(thisObject, (byte)e);
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                Systems.Debugger.Write(ex);
                Console.WriteLine("Player_Effect_CallBack() error..");
            }
        }
示例#2
0
    void Start()
    {
        targetGameObject   = transform.parent.gameObject;
        targetObjectScript = targetGameObject.GetComponent <targetObject>();

        // Particles System: off
        wind.GetComponent <ParticleSystem>().enableEmission = false;
    }
示例#3
0
    void Start()
    {
        T1 = new targetObject(GameObject.Find("MarkerX1"), H_N_N, false);
        T2 = new targetObject(GameObject.Find("MarkerA2"), H_N_N, false);
        T3 = new targetObject(GameObject.Find("MarkerQ3"), H_N_N, false);

        if (T1 == null || T2 == null || T3 == null)
        {
            Debug.Log("Couldn't find a target object");
        }
        notificationBackground.SetActive(false);
    }
示例#4
0
    private Matrix4x4 lookingForObject(targetObject Target)
    {
        if (Target.imageTarget.GetComponent <TrackableBehaviour> ().CurrentStatus == TrackableBehaviour.Status.TRACKED) // Found
        {
            if (Target.hasBeenFound == false)
            {
                Target.hasBeenFound = true;
                foundTargets++;
                notification.text = Target.imageTarget.name + " was found";
                notificationBackground.SetActive(true);
            }
            return(Matrix4x4.TRS(Target.imageTarget.transform.position, Target.imageTarget.transform.rotation, new Vector3(1, 1, 1)));
        }

        return(Target.H_Target_to_World);
    }
    public void loadData()
    {
        //string path = "Assets/Resources/targets.txt";
        //Read the text from directly from the test.txt file

        //  StreamReader reader = new StreamReader (Application.persistentDataPath + "/targets.txt");

        //  string imageTargets = reader.ReadToEnd ();

        string imageTargets = "MarkerX1$(-0.69863330, -0.03082720, 0.09498671, 0.70847630)$(0.02588051, 0.07055369, -62.37314000)$Annotation ONE GoesHere";

        string[] values = imageTargets.Split('$');

        string position, rotation;

        int counter = PROPERTIES_NUM;

        // Adds only the corresponding markers for the respected values
        if (values.Length >= 4)
        {
            T1 = new targetObject(GameObject.Find("MarkerX1"), H_N_N, false);
            TArray.Add(T1);
        }
        else if (values.Length >= 8)
        {
            T2 = new targetObject(GameObject.Find("MarkerA2"), H_N_N, false);
            TArray.Add(T2);
        }
        else if (values.Length >= 12)
        {
            T3 = new targetObject(GameObject.Find("MarkerQ3"), H_N_N, false);
            TArray.Add(T3);
        }


        foreach (var target in TArray)
        {
            //PARSE ROTATION
            rotation = values[counter - 3];

            // //Remove parenthesis
            rotation = rotation.Remove(0, 1);
            rotation = rotation.Remove(rotation.Length - 1, 1);
            string[] singleValue = rotation.Split(',');
            target.rotation = new Quaternion(float.Parse(singleValue[0], CultureInfo.InvariantCulture.NumberFormat), float.Parse(singleValue[1], CultureInfo.InvariantCulture.NumberFormat), float.Parse(singleValue[2], CultureInfo.InvariantCulture.NumberFormat), float.Parse(singleValue[3], CultureInfo.InvariantCulture.NumberFormat));

            //PARSE POSITION
            position = values[counter - 2].ToString();
            //Remove parenthesis
            position        = position.Remove(0, 1);
            position        = position.Remove(position.Length - 1, 1);
            singleValue     = position.Split(',');
            target.position = new Vector3(float.Parse(singleValue[0], CultureInfo.InvariantCulture.NumberFormat), float.Parse(singleValue[1], CultureInfo.InvariantCulture.NumberFormat), float.Parse(singleValue[2], CultureInfo.InvariantCulture.NumberFormat));

            target.H_Target_to_T1 = Matrix4x4.TRS(target.position, target.rotation, new Vector3(1, 1, 1));

            //PARSE ANNOTATION
            target.annotation = values[counter - 1].ToString();

            counter += PROPERTIES_NUM;
        }

        //reader.Close ();
    }
示例#6
0
    public void loadData()
    {
        T1 = new targetObject(GameObject.Find("MarkerX1"), H_N_N, false);
        T2 = new targetObject(GameObject.Find("MarkerA2"), H_N_N, false);
        T3 = new targetObject(GameObject.Find("MarkerQ3"), H_N_N, false);

        TArray.Add(T1);
        TArray.Add(T2);
        TArray.Add(T3);

        //string path = "Assets/Resources/targets.txt";
        //Read the text from directly from the test.txt file

        StreamReader reader = new StreamReader(Application.persistentDataPath + "/targets.txt");

        string imageTargets = reader.ReadToEnd();

        string[] values = imageTargets.Split('$');

        int    i;
        string position, rotation;

        foreach (var target in TArray)
        {
            //Debug.Log ("Values length" + values.Length);

            for (i = 4; i < values.Length + 1; i += 4)  // for because we read four properties for each
            {
                Debug.Log("Value of i :" + i);

                if (i == 4)
                {
                    //Debug.Log("Target 1 \n");
                    //Debug.Log(values[i - 3].ToString()); // rotation
                    //PARSE ROTATION
                    rotation = values[i - 3];

                    // //Remove parenthesis
                    rotation = rotation.Remove(0, 1);
                    rotation = rotation.Remove(rotation.Length - 1, 1);
                    string[] singleValue = rotation.Split(',');
                    T1.rotation = new Quaternion(float.Parse(singleValue[0], CultureInfo.InvariantCulture.NumberFormat), float.Parse(singleValue[1], CultureInfo.InvariantCulture.NumberFormat), float.Parse(singleValue[2], CultureInfo.InvariantCulture.NumberFormat), float.Parse(singleValue[3], CultureInfo.InvariantCulture.NumberFormat));

                    //PARSE POSITION
                    position = values[i - 2].ToString();
                    //Remove parenthesis
                    position    = position.Remove(0, 1);
                    position    = position.Remove(position.Length - 1, 1);
                    singleValue = position.Split(',');
                    T1.position = new Vector3(float.Parse(singleValue[0], CultureInfo.InvariantCulture.NumberFormat), float.Parse(singleValue[1], CultureInfo.InvariantCulture.NumberFormat), float.Parse(singleValue[2], CultureInfo.InvariantCulture.NumberFormat));

                    Debug.Log("T1 Rotation before loading into matrix: \n");
                    Debug.Log(T1.rotation.ToString("F8") + "\n");

                    T1.H_Target_to_T1 = Matrix4x4.TRS(T1.position, T1.rotation, new Vector3(1, 1, 1));

                    Debug.Log("T1 Rotation after loading into matrix H_T_T1: \n");
                    Debug.Log(T1.H_Target_to_T1.rotation.ToString("F8") + "\n");
                    //PARSE ANNOTATION
                    T1.annotation = values[i - 1].ToString();
                }
                if (i == 8)
                {
                    rotation = values[i - 3].ToString();
                    //Remove parenthesis
                    rotation = rotation.Remove(0, 1);
                    rotation = rotation.Remove(rotation.Length - 1, 1);
                    string[] singleValue = rotation.Split(',');
                    T2.rotation = new Quaternion(float.Parse(singleValue[0], CultureInfo.InvariantCulture.NumberFormat), float.Parse(singleValue[1], CultureInfo.InvariantCulture.NumberFormat), float.Parse(singleValue[2], CultureInfo.InvariantCulture.NumberFormat), float.Parse(singleValue[3], CultureInfo.InvariantCulture.NumberFormat));

                    //PARSE POSITION
                    position = values[i - 2].ToString();
                    //Remove parenthesis
                    position    = position.Remove(0, 1);
                    position    = position.Remove(position.Length - 1, 1);
                    singleValue = position.Split(',');
                    T2.position = new Vector3(float.Parse(singleValue[0], CultureInfo.InvariantCulture.NumberFormat), float.Parse(singleValue[1], CultureInfo.InvariantCulture.NumberFormat), float.Parse(singleValue[2], CultureInfo.InvariantCulture.NumberFormat));

                    Debug.Log("T2 Rotation before loading into matrix: \n");
                    Debug.Log(T2.rotation.ToString("F8") + "\n");

                    T2.H_Target_to_T1 = Matrix4x4.TRS(T2.position, T2.rotation, new Vector3(1, 1, 1));

                    Debug.Log("T2 Rotation after loading into matrix H_T_T1: \n");
                    Debug.Log(T2.H_Target_to_T1.rotation.ToString("F8") + "\n");
                    //PARSE ANNOTATION
                    T2.annotation = values[i - 1].ToString();
                }
                if (i == 12)
                {
                    rotation = values[i - 3].ToString();
                    //Remove parenthesis
                    rotation = rotation.Remove(0, 1);
                    rotation = rotation.Remove(rotation.Length - 1, 1);
                    string[] singleValue = rotation.Split(',');
                    T3.rotation = new Quaternion(float.Parse(singleValue[0], CultureInfo.InvariantCulture.NumberFormat), float.Parse(singleValue[1], CultureInfo.InvariantCulture.NumberFormat), float.Parse(singleValue[2], CultureInfo.InvariantCulture.NumberFormat), float.Parse(singleValue[3], CultureInfo.InvariantCulture.NumberFormat));

                    //PARSE POSITION
                    position = values[i - 2].ToString();
                    //Remove parenthesis
                    position    = position.Remove(0, 1);
                    position    = position.Remove(position.Length - 1, 1);
                    singleValue = position.Split(',');
                    T3.position = new Vector3(float.Parse(singleValue[0], CultureInfo.InvariantCulture.NumberFormat), float.Parse(singleValue[1], CultureInfo.InvariantCulture.NumberFormat), float.Parse(singleValue[2], CultureInfo.InvariantCulture.NumberFormat));

                    Debug.Log("T3 Rotation before loading into matrix: \n");
                    Debug.Log(T3.rotation.ToString("F8") + "\n");

                    /////////SETTRS??
                    T3.H_Target_to_T1 = Matrix4x4.TRS(T3.position, T3.rotation, new Vector3(1, 1, 1));

                    Debug.Log("T3 Rotation after loading into matrix H_T_T1: \n");
                    Debug.Log(T3.H_Target_to_T1.rotation.ToString("F8") + "\n");
                    //PARSE ANNOTATION
                    T3.annotation = values[i - 1].ToString();
                }
            }
        }
        reader.Close();
    }
 WriteWeak(targetObject, sourceObject);