Skip to content

Instantly share code, notes, and snippets.

View seferciogluecce's full-sized avatar
Curious

Ece Sefercioğlu seferciogluecce

Curious
View GitHub Profile
using UnityEngine;
[RequireComponent(typeof(Rigidbody))]
[RequireComponent(typeof(Collider))]
public class DragAndShoot : MonoBehaviour
{
private Vector3 mousePressDownPos;
private Vector3 mouseReleasePos;
private Rigidbody rb;
using UnityEngine;
public class Spawner : MonoBehaviour
{
private Vector3 SpawnPos;
public GameObject spawnObject;
private float newSpawnDuration = 1f;
#region Singleton
using UnityEngine;
[RequireComponent(typeof(Rigidbody))]
[RequireComponent(typeof(Collider))]
public class Stick : MonoBehaviour
{
public string StuckObjectTag = "Wall";
private void OnCollisionEnter(Collision other)
using UnityEngine;
[RequireComponent(typeof(MeshRenderer))]
[RequireComponent(typeof(Collider))]
[RequireComponent(typeof(DragAndShoot))]
public class MaterialChanger : MonoBehaviour
{
public Material CorrectMat;
public Material WrongMat;
private MeshRenderer m_meshRenderer;
using UnityEngine;
public class AutomaticShooter : MonoBehaviour
{
public GameObject SpawnPrefab;
public float newSpawnDuration = 0.1f;
public float forceMultiplier = 2;
private Vector3 SpawnPos;
private Vector3 SpawnScreenPos;
using System.Collections;
using UnityEngine;
public class Cubifier : MonoBehaviour
{
public GameObject TargetCube;
public Vector3 SectionCount;
public Material SubCubeMaterial;
@seferciogluecce
seferciogluecce / CenterSurrounder.cs
Last active August 19, 2020 12:57
Surround Spawn Tutorial In Unity @Devsplorer @ https://youtu.be/9wr81-ButnM
using System.Collections;
using UnityEngine;
public class CenterSurrounder : MonoBehaviour
{
public GameObject OriginalSurrounderObject;
public int SurrounderObjectCount;
private readonly float AppearWaitDuration = 0.3f;
private Transform SurrounderParentTransform;
@seferciogluecce
seferciogluecce / Rotater.cs
Created August 22, 2020 16:18
Usage tutorial @Devsplorer @ https://youtu.be/qSTv5-FBkL0
using System;
using UnityEngine;
public class Rotater : MonoBehaviour
{
private Transform ToRotate;
private bool RotationStarted = false;
private float Speed = 50.0f;
public Vector3 Axis;
using System.Collections.Generic;
using UnityEngine;
using Random = UnityEngine.Random;
public enum SwitchHighlightMode
{
Random,
InOrder //Loop
}
@seferciogluecce
seferciogluecce / RotateWithMouse.cs
Last active August 17, 2021 15:22
How To Rotate Camera In X Y Axes In Unity With Mouse Press | Unity 3D Tutorial at https://youtu.be/FIiKuP-9KuY
using UnityEngine;
public class RotateWithMouse : MonoBehaviour
{
public float Speed = 5;
void Update()
{
if(Input.GetMouseButton(0))