コード例 #1
0
ファイル: Gizmo.cs プロジェクト: farandal/SpaceShipShooter
    // Start is called before the first frame update
    void Start()
    {
        if (this.target == null)
        {
            return;
        }

        xAxis = new GameObject {
            name = "xAxis"
        };
        xAxis.DrawCircle(objectRadius, 2f, Color.red, xAxisRotationVect);
        //xAxis.transform.rotation = Quaternion.Euler(xAxisRotationVect);
        //xAxis.transform.Rotate (yAxisRotationVect,Space.Self);
        xAxis.transform.position = transform.position;
        xAxis.transform.SetParent(transform, true);

        yAxis = new GameObject {
            name = "yAxis"
        };
        yAxis.DrawCircle(objectRadius, 2f, Color.green, yAxisRotationVect);
        //yAxis.transform.Rotate (yAxisRotationVect,Space.Self);
        //yAxis.transform.rotation = Quaternion.Euler(yAxisRotationVect);
        yAxis.transform.position = transform.position;
        yAxis.transform.SetParent(transform, true);

        zAxis = new GameObject {
            name = "zAxis"
        };
        zAxis.DrawCircle(objectRadius, 2f, Color.blue, zAxisRotationVect);
        //zAxis.transform.Rotate (zAxisRotationVect,Space.Self);
        //zAxis.transform.rotation = Quaternion.Euler(zAxisRotationVect);
        zAxis.transform.position = transform.position;
        zAxis.transform.SetParent(transform, true);


        roll = gameObject.AddComponent <Roll> () as Roll;
        roll.SetAngles(-33, 33);

        jaw = gameObject.AddComponent <Jaw> () as Jaw;
        jaw.SetAngles(-16, 16);

        pitch = gameObject.AddComponent <Pitch> () as Pitch;
        pitch.SetAngles(16, -16);
    }