protected override void Awake()
    {
        base.Awake();

        defaultSpeed     = speed;
        defaultTurnSpeed = turnSpeed;
        if (isLockFlat)
        {
            lockVector = new Vector3(1, 0, 1);
        }
        pointCtrl = myTran.GetComponentInChildren <LaserPointerController>();
    }
 void Start()
 {
     trackedObj      = GetComponentInParent <SteamVR_TrackedObject>();
     laserController = GetComponentInParent <LaserPointerController>();
     cameraHead      = GameObject.Find("Camera (head)");
     cameraRig       = GameObject.Find("[CameraRig]");
     if (TargetPlayareaPrefab != null)
     {
         targetPlayareaInstance = Instantiate(TargetPlayareaPrefab);
         targetPlayareaInstance.transform.SetParent(null);
         targetPlayareaInstance.SetActive(false);
     }
 }
    protected override void Awake()
    {
        base.Awake();

        if (rollBody == null)
        {
            rollBody = myTran;
        }
        else
        {
            defaultBodyRot = rollBody.localRotation;
        }
        pointCtrl = myTran.GetComponentInChildren <LaserPointerController>();
    }
Esempio n. 4
0
    //レーザーポインター取得
    protected void GetLaserPointer()
    {
        Transform targetSight = transform.Find(UNIT_PARTS_TARGET_SIGHT);

        if (targetSight == null)
        {
            return;
        }
        laserPointerCtrl = targetSight.GetComponent <LaserPointerController>();

        if (laserPointerCtrl != null)
        {
            laserPointerCtrl.SetLayerMask(LayerMask.GetMask(new string[] { Common.CO.layerUnitArray[enemySide] }));
            Color color = (mySide == Common.CO.SIDE_MINE) ? Color.cyan : Color.red;
            laserPointerCtrl.SetLaserColor(color);
        }
    }
Esempio n. 5
0
        private static void DrawViewLine(ConCommandArgs args)
        {
            var                    localMaster            = PlayerCharacterMasterController.instances[0].master;
            GameObject             bodyInstanceObject     = localMaster.bodyInstanceObject;
            CharacterBody          characterBody          = bodyInstanceObject.GetComponent <CharacterBody>();
            LaserPointerController laserPointerController = bodyInstanceObject.GetComponent <LaserPointerController>();

            if (laserPointerController)
            {
                UnityEngine.Object.Destroy(laserPointerController);
                UnityEngine.Object.Destroy(bodyInstanceObject.GetComponent <LaserPointer>());
            }
            else
            {
                laserPointerController = bodyInstanceObject.AddComponent <LaserPointerController>();
                LaserPointer laserPointer = bodyInstanceObject.AddComponent <LaserPointer>();
                laserPointer.laserDistance    = 10000f;
                laserPointerController.source = characterBody.inputBank;
                laserPointerController.beam   = laserPointer.line;
            }
        }