示例#1
0
    // Start is called before the first frame update
    void Start()
    {
        rb              = GetComponent <Rigidbody>();
        player          = GameObject.Find("Player");
        playerTransform = player.transform.position;
        // get player position
        sc    = GetComponentInChildren <detect>();
        sc.ps = GetComponent <enemyaction>();

        enemy_color  = GetComponent <Renderer>();
        corona_color = enemy_color.material.color;
        UnityEngine.Debug.Log(corona_color.r);
        x_color_offset = (255f - (corona_color.r * 255f)) / 5;
        y_color_offset = (255f - (corona_color.g * 255f)) / 5;
        z_color_offset = (255f - (corona_color.b * 255f)) / 5;
    }
示例#2
0
        public void Detect(string names, string filename)
        {
            IntPtr pAddressOfFunctionToCall = DllLoader.GetProcAddress(pDll, "detect");

            if (pAddressOfFunctionToCall == IntPtr.Zero)
            {
                Trace.WriteLine("Error loading function: detect");
            }
            detect detect =
                (detect)Marshal.GetDelegateForFunctionPointer(pAddressOfFunctionToCall, typeof(detect));

            IntPtr sw_filename = sw_string(filename);
            IntPtr sw_names    = sw_string(names);

            AnomalyReportVector = detect(this.detector, sw_names, names.Length, sw_filename);
            DisposeDLLObject(sw_filename);
            DisposeDLLObject(sw_names);
        }
示例#3
0
 // Start is called before the first frame update
 void Start()
 {
     compassScript = compass.GetComponent <Compass>();
     detectScript  = home.GetComponent <detect>();
 }
示例#4
0
 private void Start()
 {
     instance = this;
     lastpos  = this.transform.position.x;
     contextClue.gameObject.SetActive(false);
 }